Four kinds of principles of design patterns

  • Single Responsibility Principle

  • Open Closed Principle

  • Dependency Inversion principle

  • Richter substitution principle

A single responsibility principle

Definition: On a category, it should only be one the cause of change.

Second, the open closed principle

Software entities (classes, interfaces, methods, etc.) should develop open, closed for modification.

Third, the Dependency Inversion principle

  1. Details depend on abstractions, rather than rely on abstract details.

  2. High-level and low-level code should depend on abstractions, rather than rely on the lower level.

Fourth, Richter substitution principle

Subclasses can replace parent

Guess you like

Origin www.cnblogs.com/yfy-/p/11925543.html