Android 源码设计模式总结
设计模式可以按照创建型设计模式、结构型设计模式、行为型设计模式分为 3 类,共 23 种设计模式。
创建型设计模式
创建型设计模式共有 5 种。
工厂方法 Factory Method
抽象工厂 Abstract Factory
建造者 Builder
原型 Prototype
单例 Singleton
结构型设计模式
结构型设计模式共有 7 种。
适配器 Adapter
桥接 Bridge
组合 Composite
装饰者 Decorator
外观 Facade
享元 Flyweight
代理 Proxy
行为型设计模式
行为型设计模式共有 11 种。
解释器 Interpreter
模板方法 Template Method
职责链 Chain of Responsibility
命令 Command
迭代器 Iterator
中介者 Mediator
备忘录 Memento
观察者 Observer
状态 State
策略 Strategy
访问者 Visitor