Single Responsibility Principle: For a class, there should be only one reason for its change
If a class assumes too many responsibilities, it is equivalent to coupling these responsibilities. This coupling will lead to a fragile design.
Open-closed Principle: For extensions, for modified closures
Dependency inversion principle: Abstraction should not depend on details. Details should depend on abstraction. To put it bluntly, it is necessary to program interfaces rather than implement programming.
Rishi replacement principle: child types must be able to replace their parent types. That is to say, in the software, all the parent classes are replaced with their child classes, and the program's behavior remains unchanged.
Dimit rule: In the structure design of classes, each class should minimize the access permissions of members, emphasizing the loose coupling between classes. The weaker the coupling between classes, the more conducive to reuse, A class in weak coupling is modified and will not affect related classes.
If the two classes do not need to communicate with each other directly, do not directly interact with each other. If one class needs to call the method of the other class, you can forward the call through a third party.