面向对象的设计原则总述

设计原则:

 

1.“开-闭”原则 Open-Closed principle, OCP

 

2. 里氏代换原则 Liskov Substitution Principle, LSP

 

3.依赖倒转原则 Dependency Inversion Principle, DIP

 

4.接口隔离原则  Interface Segregation Principle, ISP

 

5.合成/聚合复用原则 Composition/Aggregation Principle, CARP

 

6.迪米特法则 Law of Demeter, LoD

 

系统的可扩展性是由1,2,3,5原则所保证的。

系统的灵活性是由146所保证的。

系统的可插入性是由1235所保证的。

你可能感兴趣的:(扩展,interface)