软件设计的原则整理

Don’t Repeat Yourself (DRY)

Program to an interface, not an implementation

Keep It Simple, Stupid (KISS)

Command-Query Separation (CQS) – 命令-查询分离原则

You Ain’t Gonna Need It (YAGNI)

Law of Demeter – 迪米特法则

面向对象的S.O.L.I.D 原则

  • Single Responsibility Principle (SRP) – 职责单一原则
  • Open/Closed Principle (OCP) – 开闭原则
  • Liskov substitution principle (LSP) – 里氏代换原则
  • Interface Segregation Principle (ISP) – 接口隔离原则
  • Dependency Inversion Principle (DIP) – 依赖倒置原则

Common Closure Principle(CCP)– 共同封闭原则

Common Reuse Principle (CRP) – 共同重用原则

Hollywood Principle – 好莱坞原则

High Cohesion & Low/Loose coupling & – 高内聚, 低耦合

Convention over Configuration(CoC)– 惯例优于配置原则

Separation of Concerns (SoC) – 关注点分离

Design by Contract (DbC) – 契约式设计

Acyclic Dependencies Principle (ADP) – 无环依赖原则

参考资料

http://coolshell.cn/articles/4535.html