Design Principles

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

1.1 Single Responsibility Principle (SRP) – 职责单一原则

1.2 Open/Closed Principle (OCP) – 开闭原则

1.3 Liskov substitution principle (LSP) – 里氏代换原则

1.4 Interface Segregation Principle (ISP) – 接口隔离原则

1.5 Dependency Inversion Principle (DIP) – 依赖倒置原则

2. Don’t Repeat Yourself (DRY)

3. Keep It Simple, Stupid (KISS)

4. Program to an interface, not an implementation

4.1 Composition over inheritance

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

6. You Ain’t Gonna Need It (YAGNI)

7. Law of Demeter – 迪米特法则

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

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

10. Hollywood Principle – 好莱坞原则: don’t call us, we’ll call you.

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

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

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

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

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

16. Encapsulation and Information Hiding

17. Dependency Injection (DI)

18. Inversion of Control (IoC)

19. Avoid Fragile Baseclass

20. Has-a Is-a

21. What is Identity

22. Interchangeability

23. Option-operand separation

24. Intention Revealing Names

25. Zero Friction Development

26. Encapsulate Variation

27. Do the simplest thing that could possibly work

28. Don’t make me think

29. Write Code for the Maintainer

30. Principle of least astonishment

31. Hide Implementation Details

32. Avoid Premature Optimization 避免过早优化

33. Code Reuse is Good

34. Embrace Change

35. Rule Of Three

Link:

Lumiera: Clean Code Development

DDD,

Entities, Value Objects, Aggregates and Roots

The Principles of Good Programming, chinese

从面向对象的设计模式看软件设计