設計模式圖解
一、構建型ui
- 工廠方法模式
- 抽象工廠模式
- 元素:抽象工廠、具體工廠、抽象產品、具體產品
- 與工廠方法區別:工廠方法負責一個產品等級,抽象工廠負責同一族多個產品等級
- 產品族:某一類產品,電冰箱是一族;產品等級:同一族產品的某一類,例如:海爾電冰箱是一個產品等級
- build模式
- 元素:指揮者、抽象建造者、具體建造者、具體產品、抽象產品
- 單例模式
- 元素:單例對象
- 一個私有構造方法、自行建立、本身向外提供一個全局的
二、結構型代理
- 適配器模式
- 元素:Target:目標接口、Adaptor:適配器、Adaptee:實際接口
- 橋接模式
- 元素:Abstraction、Implementor、ConcreteImplementor、RefinedAbstraction
- 代理模式
- 元素:Client、Proxy、RealObject
- 裝飾模式
- 元素:Component、ConcreteComponent、Decorator、ConcreteDecortor
- 享元模式
- 元素:FlyWeightFactory、FlyWeight、ConcreteFlyWeight
- 外觀模式
三、行爲型server
- 中介模式
- Mediator、Colleger、ConcreteColleger
- 觀察者模式
- Subject、Observer、ConcreteObserver
- 命令模式
- client、Receiver、Command/ConcreteCommand、Invoker
- 狀態模式
- Context、State、ConcreteState
- 策略模式
- Context、Strategy、ConcreteStrategy
歡迎關注本站公眾號,獲取更多信息