Object-oriented five duties

1, the principle of a single duty high cohesion, low coupling

2, open closed principle, be open for extension, closed for modification

3, the replacement in principle, a subclass of the base class can be replaced, it is to ensure that inherited multiplexed basis

4. Dependency Inversion principle, depend on abstractions. Do not rely on the underlying level module, it depends on the abstract; abstract does not rely on specific, dependent on the particular abstract

5, the interface segregation principle, the use of multiple small specialized interface does not use a large interface.     

Guess you like

Origin www.cnblogs.com/shaozhen/p/11121255.html