1, single duty principle: For a class, there should be only one cause of its change;
2, the Richter substitution principle: Subclasses must be able to replace the parent type with them;
3, open-closed principle: The program's entity objects (modules, classes, functions, etc.) should be extensible, but should not be able to modify;
1), two features of the open closure principle:
A), which is open for expansion;
b), for the modification is closed;
2) to realize the core idea of open-closed:
Face abstract programming, rather than specific programming.
4, relies on the reversal principle: The program's high-level module should not rely on the lower layer module, but both should depend on the abstraction, the abstraction should not depend on the concrete detail, but the detail should depend on the abstraction;
The meaning of the expression is that object-oriented should be programmed for the interface, not for implementation;
5, synthesis/aggregation reuse principle: Try not to use class inheritance, and use composition/aggregation as much as possible;
6, Dimitri rule: if there is no direct communication between the two classes, these two classes should not have a direct interaction. Day over one of the classes requires invoking a method in another class, which can be forwarded by a third party;
Dimitri: Emphasizing the need to implement loose coupling as much as possible between classes. The weaker the coupling between classes, the more beneficial it is to use multiplexing, where a weakly coupled class is modified without affecting the related classes, which in turn can cause a lot of trouble.
?
Six design principles of design pattern