设计模式学习目录
設計模式的定義
設計模式(Design Pattern)是一套被反復使用、多數人知曉的、經過分類編目的、代碼設計經驗的總結,使用設計模式是為了可重用代碼、讓代碼更容易被他人理解并且保證代碼可靠性。
UML類圖基礎知識:
UML類圖介紹和元素信息
UML類圖對應關系和對應代碼
?
面向對象的七種設計原則:
1.開閉原則(Open-Closed Principle)
2.單一職責原則(Single Responsibility Principle)
3.里氏代換原則(Liskov Substitution Principle)
4.依賴倒轉原則(Dependency Inversion Principle)
5.接口隔離原則(Interface Segregation Principle)
6.合成復用原則(Composite Reuse Principle)
7.迪米特法則(Law of Demeter)
?
設計模式表單:
| ? 創建型 | 工廠方法模式(Factory Method Pattern) | ★★☆☆☆ | ★★★★★ |
| 抽象工廠模式(Abstract Factory Pattern) | ★★★★☆ | ★★★★★ | |
| 建造者模式(Builder Pattern) | ★★★★☆ | ★★☆☆☆ | |
| 原型模式(Prototype Pattern) | ★★★☆☆ | ★★★☆☆ | |
| 單例模式(Singleton Pattern) | ★☆☆☆☆ | ★★★★☆ | |
| 行為型 | 適配器模式(Adapter Pattern) | ★★☆☆☆ | ★★★★☆ |
| 橋接模式(Bridge Pattern) | ★★★☆☆ | ★★★☆☆ | |
| 組合模式(Composite Pattern) | ★★★☆☆ | ★★★★☆ | |
| 裝飾模式(Decorator Pattern) | ★★★☆☆ | ★★★☆☆ | |
| 外觀模式(Facade Pattern) | ★☆☆☆☆ | ★★★★★ | |
| 享元模式(Flyweight Pattern) | ★★★★☆ | ★☆☆☆☆ | |
| 代理模式(Proxy Pattern) | ★★★☆☆ | ★★★★☆ | |
| 結構型 | 職責鏈模式(Chain of Responsibility Pattern) | ★★★☆☆ | ★★☆☆☆ |
| 命令模式(Command Pattern) | ★★★☆☆ | ★★★★☆ | |
| 解釋器模式(Interpreter Pattern) | ★★★★★ | ★☆☆☆☆ | |
| 迭代器模式(Iterator Pattern) | ★★★☆☆ | ★★★★★ | |
| 中介者模式(Mediator Pattern) | ★★★☆☆ | ★★☆☆☆ | |
| 備忘錄模式(Memento Pattern) | ★★☆☆☆ | ★★☆☆☆ | |
| 觀察者模式(Observer Pattern) | ★★★☆☆ | ★★★★★ | |
| 狀態模式(State Pattern) | ★★★☆☆ | ★★★☆☆ | |
| 策略模式(Strategy Pattern) | ★☆☆☆☆ | ★★★★☆ | |
| 模板方法模式(Template Method Pattern) | ★★☆☆☆ | ★★★☆☆ | |
| 訪問者模式(Visitor Pattern) | ★★★★☆ | ★☆☆☆☆ |
?
?
?
總結
- 上一篇: 一个例子探究jQuery的Ajax应用(
- 下一篇: 数据挖掘网上资料大全