常见设计原则和设计模式一览表

1.设计原则

设计原则英文
单一职责原则Simple Responsibility Principle, SRP
开闭原则Open Close Principle, OCP
里氏替换原则Liskov Substitution Principle, LSP
依赖倒置原则Dependence Inversion Principle, DIP
接口隔离原则Interface Segregation Principle, ISP
合成/聚合复用原则Composite/Aggregate Reuse Principle, CARP
迪米特法则
或 最少知道原则
Law of Demeter, LoD
或 Least Knowledge Principle, LKP

2.设计模式

具体可参考:https://github.com/me115/design_patternshttps://design-patterns.readthedocs.io/

创建型模式(6)英文
简单工厂模式,又称静态工厂方法模式Simple Factory Pattern,Static Factory Method Pattern
工厂方法模式,又称工厂模式Factory Method Pattern,Factory Pattern
抽象工厂模式Abstract Factory Pattern
生成器模式Builder Pattern
原型模式Prototype Pattern
单例模式Singleton Pattern
结构型模式(7)描述
适配器模式Adapter Pattern
桥接模式Bridge Pattern
组合模式Composite Pattern
装饰器模式Decorator Pattern
门面模式Facade Pattern
享元模式Flyweight Pattern
代理模式Proxy Pattern
行为型模式(11)描述
责任链模式Chain of Responsibility Pattern
命令模式Command Pattern
解释器模式Interpreter Pattern
迭代器模式Iterator Pattern
中介模式Mediator Pattern
备忘录模式Memento Pattern
观察者模式Observer Pattern
状态模式State Pattern
策略模式Strategy Pattern
模板方法模式Template Method Pattern
访问者模式Vistor Pattern

原创文章,作者:huoxiaoqiang,如若转载,请注明出处:https://www.huoxiaoqiang.com/experience/osexp/20144.html

(0)
huoxiaoqiang的头像huoxiaoqiang
上一篇 2023年2月10日
下一篇 2023年2月14日

相关推荐

发表回复

登录后才能评论