Update 设计模式 - 桥接.md

小节标题改为中文,重新绘制类图,补充参考资料。
This commit is contained in:
CyC2018
2026-10-28 03:19:58 +08:00
parent cdafba91ac
commit ac386a6d96
2 changed files with 10 additions and 9 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

+10 -9
View File
@@ -2,19 +2,16 @@
## 桥接(Bridge)
### Intent
### 意图
将抽象与实现分离开来,使它们可以独立变化。
### Class Diagram
### 类图
- Abstraction:定义抽象类的接口
- Implementor:定义实现类接口
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/2a1f8b0f-1dd7-4409-b177-a381c58066ad.png"/> </div><br>
### Implementation
<div align="center"> <img src="pics/dp-bridge.png" width="760px"/> </div><br>
### 实现
RemoteControl 表示遥控器,指代 Abstraction。
TV 表示电视,指代 Implementor。
@@ -152,7 +149,11 @@ public class Client {
}
```
### JDK
### JDK 中的应用
- AWT (It provides an abstraction layer which maps onto the native OS the windowing support.)
- JDBC
## 参考资料
- 弗里曼. Head First 设计模式 [M]. 中国电力出版社, 2007.
- Gamma E. 设计模式: 可复用面向对象软件的基础 [M]. 机械工业出版社, 2007.