# 6种设计原则,23种设计模式 **Repository Path**: xi_project/Design-pattern ## Basic Information - **Project Name**: 6种设计原则,23种设计模式 - **Description**: 6种设计原则,23种设计模式 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 18 - **Forks**: 10 - **Created**: 2020-11-14 - **Last Updated**: 2024-03-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 6种设计原则,23种设计模式 #### 设计模式的目的 1. 代码重用性 2. 可读性 3. 可扩展性 4. 可靠性 5. 高内聚,低耦合 #### 6种设计原则 1. 单一职责原则Single Responsibility Principle(重要) 2. 里氏替换原则(重要) 3. 依赖倒置原则(重要) 4. 接口隔离原则(重要) 5. 迪米特法则(重要) 6. 开闭原则(重要) | 设计原则 | Design principle | | ----------------- | ------------------------------------ | | `单一职责原则SRP` | `Single Responsibility Principle` | | `里氏替换原则LSP` | `Liskov Substitution Principle` | | `依赖倒置原则DIP` | `Dependence Inversion Principle` | | `接口隔离原则ISP` | `Interface Segregation Principle` | | `迪米特法则LOD` | `Law of Demeter Principle` | | `开闭原则OCP` | `Open Closed Principle` | #### 23种设计模式 1. 单例模式(重要) 2. 工厂方法模式(重要) 3. 抽象工厂模式 4. 模板方法模式(重要) 5. 建造者模式(重要) 6. 代理模式(重要) 7. 原型模式(重要) 8. 中介者模式 9. 命令模式 10. 责任链模式(重要) 11. 装饰模式(重要) 12. 策略模式(重要) 13. 适配器模式 14. 迭代器模式 15. 组合模式 16. 观察者模式(重要) 17. 门面模式 18. 备忘录模式 19. 访问者模式 20. 状态模式 21. 解释器模式 22. 亨元模式 23. 桥梁模式 | 设计原则 | Design principle | | ----------------- | ------------------------------------ | | `单例模式` | `Singleton Pattern` | | `工厂模式` | `Factory Pattern` | | `抽象工厂模式` | `Abstract Factory Pattern` | | `模板方法模式` | `Template Method Pattern` | | `建造者模式` | `Builder Pattern` | | `代理模式` | `Proxy Pattern` | | `原型模式` | `Prototype Pattern` | | `中介者模式` | `Mediator Pattern` | | `命令模式` | `Command Pattern` | | `责任链模式` | `Responsibility Chain Pattern` | | `装饰模式` | `Decorator Pattern` | | `策略模式` | `Strategy Pattern` | | `适配器模式` | `Adapter Pattern` | | `迭代器模式` | `Iterator Pattern` | | `组合模式` | `Combination Pattern` | | `观察者模式` | `Observer Pattern` | | `门面模式/外观模式` | `Facade Pattern` | | `备忘录模式` | `Memento Pattern` | | `访问者模式` | `Visitor Pattern` | | `状态模式` | `State Pattern` | | `解释器模式` | `Interpreter Pattern` | | `亨元模式` | `Flyweight Pattern` | | `桥梁模式` | `Bridge Pattern` | #### 参考书籍 设计模式之禅