Skip to content

Commit 689945e

Browse files
committed
readme
1 parent 5238bdb commit 689945e

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

Facade/README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
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)

Facade/facade.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
/*
2-
Facade 外觀模式:
3-
為子系統中的一組介面提供一個一致的界面,此模式定義了一個高層介面,
4-
這個介面使得這一子系統更加容易使用(投資:基金,股票,房產)
5-
6-
個人想法:Mediator 中介者模式、外觀模式:每個對像都保存一份中介者對象,
7-
在和其他對象交互時,通過中介者來完成,
8-
外觀模式:外觀中保存了一堆對象,這些對像或者是組成某個子系統的,
9-
將其封裝在外觀對像中,給客戶端一種只有一個對象的感覺,
10-
外觀模式是一結構型模式,
11-
中介者模式是一行為性模式
12-
*/
131
package facade
142

153
import "fmt"

0 commit comments

Comments
 (0)