23种设计模式

设计模式的核心在于提供了解决某种问题的解决方案,方便人们复用成功的设计和体系结构
创建型 行为型 结构型
image

抽象工厂模式
image

Builder 生成器模式
image

prototype 原型模式

image

singleton 单例模式

image
image

adapter 适配器模式
image

Bridge 桥接模式

image

image

Composite 组合模式

image

Decorator 装饰器模式
image

image

Facade 外观模式
为一个复杂子系统提供一个简单接口
image

Flyweight
享元模式
image

image

Proxy 代理模式

image

image

Chain of Responsibility 责任链模式

一个客户需要使用一组相关对象

image

Command 命令模式

image

image

Interpreter 解释器模式

image

Iterator 迭代器模式
image

image

Mediator 中介者模式

image

image

Memento 备忘录模式

image

image

Observer 观察者模式

当一个对象状态改变时,所有依赖它的对象得到通知并自动更新

观察者模式通过引入其他对象来分布通信

image

image

image

State 状态模式

一个对象在其内部状态改变的时候改变它的行为

image

Strategy 策略模式

image

image

image

Template Method 模板方法模式

image

image

Visitor 访问者模式

image

image

image

posted @ 2025-10-27 18:06  向恦  阅读(1)  评论(0)    收藏  举报