Java中的23种设计模式可以分为三大类:

1.创建型模式(Creational Patterns)

创建型模式关注于如何实例化一个对象或一组相关对象。它们被用于解决对象创建的问题,封装了对象的实例化过程。

1.1. 简单工厂模式(Simple Factory Pattern)

1.2. 工厂方法模式(Factory Method Pattern)

1.3. 抽象工厂模式(Abstract Factory Pattern)

1.4. 单例模式(Singleton Pattern)

1.5. 建造者模式(Builder Pattern)

1.6. 原型模式(Prototype Pattern)

2.结构型模式(Structural Patterns)

结构型模式关注于如何组合类和对象以构建更大的结构。它们被用于解决类或对象的组合问题。

2.1. 适配器模式(Adapter Pattern)

2.2. 桥接模式(Bridge Pattern)

2.3. 组合模式(Composite Pattern)

2.4. 装饰模式(Decorator Pattern)

2.5. 外观模式(Facade Pattern)

2.6. 享元模式(Flyweight Pattern)

2.7. 代理模式(Proxy Pattern)

3.行为型模式(Behavioral Patterns)

行为型模式关注于对象之间的通信和协作,以及如何在运行时组织和管理对象之间的关系。

3.1. 职责链模式(Chain of Responsibility Pattern)

3.2. 命令模式(Command Pattern)

3.3. 解释器模式(Interpreter Pattern)

3.4. 迭代器模式(Iterator Pattern)

3.5. 中介者模式(Mediator Pattern)

3.6. 备忘录模式(Memento Pattern)

3.7. 观察者模式(Observer Pattern)

3.8. 状态模式(State Pattern)

3.9. 策略模式(Strategy Pattern)

3.10. 模板方法模式(Template Method Pattern)

3.11. 访问者模式(Visitor Pattern)

java的所有设计模式

原文地址: http://www.cveoy.top/t/topic/tL5 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录