设计模式概述
"设计模式"总的来说有设计原则6个,设计模式3类23种:
- 单一职责原则(Single Responsibility Principle, SRP)
- 开闭原则(Open Close Principle, OCP)
- 里氏替换原则(Liskov Substitution Principle, LSP)
- 依赖倒转原则(Dependence Inversion Principle, DIP)
- 接口隔离原则(Interface Segregation Principle, ISP)
- 迪米特法则(Law of Demeter, LoD), 最少知识原则(Principle of Least Knowledge)
其中,前5个原则称为SOLID原则
3类设计模式,共23个
创建型模式(Creational patterns)
结构型模式(Structural patterns)
- 代理模式(Proxy)
- 组合模式(Composite)
- 适配器模式(Adapter)
- 装饰模式(Decorator)
- 享元模式(Flyweight)
- 外观模式(Facade)
- 桥接模式(Bridge)
行为型模式(Behavioral patterns)
- 策略模式(Strategy)
- 状态模式(State)
- 责任链模式(Chain of responsibility)
- 解释器模式(Interpreter)
- 命令模式(Command)
- 观察者模式(Observer)
- 备忘录模式(Memento)
- 迭代器模式(Iterator)
- 模版方法模式(Template method)
- 访问者模式(Visitor)
- 中介者模式(Mediator)
设计模式这么多,这里整理了相关的易混淆的设计模式
这是作者从《Android源码设计模式解析与实战(第二版)》中提取出来的思维导图
以及作者提供的23种UML图的百度云盘