6.开闭原则

Software entities like classes,modules and functions should be open for extension but closed for modification.一个软件实体如类、模块和函数应该对扩展开放,对修改关闭。

一个软件实体应该通过扩展来实现变化,而不是通过修改已有的代码来实现变化。

  • Single Responsibility Principle:单一职责原则
  • Open Closed Principle:开闭原则
  • Liskov Substitution Principle:里氏替换原则
  • Law of Demeter:迪米特原则
  • Interface Segregation Principle:接口隔离原则
  • Dependence Inversion Principle:依赖倒置原则

SOLID

results matching ""

    No results matching ""