diff --git a/notes/pics/facade-movie.png b/notes/pics/facade-movie.png new file mode 100644 index 00000000..226c6820 Binary files /dev/null and b/notes/pics/facade-movie.png differ diff --git a/notes/设计模式 - 外观.md b/notes/设计模式 - 外观.md index a503dcdf..517bd78a 100644 --- a/notes/设计模式 - 外观.md +++ b/notes/设计模式 - 外观.md @@ -6,7 +6,7 @@ ### Class Diagram -

+

### Implementation diff --git a/tools/diagram/src/facade-movie.svg b/tools/diagram/src/facade-movie.svg new file mode 100644 index 00000000..0d07afca --- /dev/null +++ b/tools/diagram/src/facade-movie.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + 外观:一个方法替客户端完成一串调用 + + Client + + Facade + + watchMovie() + + + SubSystem + + ① turnOnTV() + + + ② setCD("a movie") + + + ③ startWatching() + + 客户端只调用 watchMovie(),不需要知道子系统中有哪些类、调用顺序是什么;需要精细控制时仍然可以直接使用子系统。 +