File tree Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Original file line number Diff line number Diff line change 1010轉接則是復用一個原有的介面, 轉接器是使兩個已有的介面協同工作
1111外觀模式用來轉接整個子系統, 轉接用來轉接物件
1212
13- ##### 個人想法:
14- Mediator 中介者模式、外觀模式:每個對像都保存一份中介者對象,
15- 在和其他對象交互時,通過中介者來完成,
16- 外觀模式:外觀中保存了一堆對象,這些對像或者是組成某個子系統的,
17- 將其封裝在外觀對像中,給客戶端一種只有一個對象的感覺,
18- 外觀模式是一結構型模式,
13+
14+ ##### 外觀 vs. [ Mediator 中介者模式] ( https://github.com/kimi0230/DesignPatternGolang/tree/master/Mediator ) 、
15+
16+ 外觀模式:外觀中保存了一堆對象,這些對像或者是組成某個子系統的,
17+ 將其封裝在外觀對像中,給客戶端一種只有一個對象的感覺,
18+ 中介者模式:
19+ 每個對像都保存一份中介者對象,
20+ 在和其他對象交互時,通過中介者來完成,
21+ 外觀模式是一結構型模式,
1922中介者模式是一行為性模式
2023
2124![ UML] ( https://github.com/kimi0230/DesignPatternGolang/blob/master/UML/Facade.png?raw=true )
Original file line number Diff line number Diff line change 1- /*
2- Facade 外觀模式:
3- 為子系統中的一組介面提供一個一致的界面,此模式定義了一個高層介面,
4- 這個介面使得這一子系統更加容易使用(投資:基金,股票,房產)
5-
6- 個人想法:Mediator 中介者模式、外觀模式:每個對像都保存一份中介者對象,
7- 在和其他對象交互時,通過中介者來完成,
8- 外觀模式:外觀中保存了一堆對象,這些對像或者是組成某個子系統的,
9- 將其封裝在外觀對像中,給客戶端一種只有一個對象的感覺,
10- 外觀模式是一結構型模式,
11- 中介者模式是一行為性模式
12- */
131package facade
142
153import "fmt"
You can’t perform that action at this time.
0 commit comments