面向对象的几个原则:
单一职责原则(Single Responsiblity Principle SRP):
开闭原则(Open Closed Principle OCP):
里氏代换原则(Liskov Substitution Principle LSP):
依赖倒转原则(Dependency Inversion Principle DIP):
接口隔离原则(Interface Segregation Principle ISP):
合成/聚合复用原则(Composite/Aggregate Reuse Principle CARP):
最小知识原则(Principle of Least Knowledge PLK):也叫迪米特法则