solid principle every developer should know SOLID principles

SOLID:

Single principle (SRP): A class should only be responsible for one thing. If a class has more than one responsibility, then it becomes a coupling. A modification of the duties would lead to changes to the other responsibilities.

Closing principle (OCP): software entities (classes, modules, functions) should be open for extension but closed for modification

Richter replace (LSP): subclasses override the parent class function, subclass must be replaced by its parent class.

Interface Isolation (ISP): The client should not be forced to rely on the interface they do not use all of his methods in the interface implementation class can be used to create client-specific fine-grained interface.

Dependency Inversion (DIP): low-level and high-level module module relies on the abstract.

 

Reference documents: every developer should know SOLID principles

Guess you like

Origin www.cnblogs.com/xiaoxue126/p/11938658.html