设计模式(Design pattern)是一套被反复使用、多数人知晓的、经过分类编目的、代码设计经验的总结。使用设计模式是为了可重用代码、让代码更容易被他人理解、保证代码可靠性。 毫无疑问,设计模式于己于他人于系统都是多赢的,设计模式使代码编制真正工程化,设计模式是软件工程的基石,如同大厦的一块块砖石一样。
创建型模式篇:
- 单件模式(Single Pattern)
- 抽象工厂模式(Abstract Factory)
- 建造者模式(Builder Pattern)
- 工厂方法(Factory Method)
- 原型模式(Protype Pattern)
构型模式篇:
- 适配器模式(Adapter Pattern)
- 桥接模式(Bridge Pattern)
- 装饰模式(Decorator Pattern)
- 组合模式(Composite Pattern)
- 外观模式(Façade Pattern)
- 享元模式(Flyweight Pattern)
- 代理模式(Proxy Pattern)
行为型模式篇:
- 模版方法模式(Template Method)
- 命令模式(Command Pattern)
- 迭代器模式(Iterator Pattern)
- 观察者模式(Oberver Pattern)
- 中介者模式(Mediator Pattern)
- 备忘录模式(Memento Pattern)
- 解释器模式(Interpreter Pattern)
- 状态模式(State Pattern)
- 策略模式(Strategy Pattern)
- 职责链模式(Chain of Responsibility)
- 访问者模式(Visitor Pattern)