Seven major design principles:
1. Single Duty principle: one class is responsible for a duty.
2, the Richter replacement principle: Subclasses can extend the function of the parent class, but cannot change the original function of the parent class.
3, dependency inversion principle: The high-level module should not rely on the lower layer module, both should rely on its abstraction; abstraction should not depend on detail; detail should depend on abstraction. That is, for interface programming, do not program for implementation.
4, interface Isolation principle: the establishment of a single interface, do not set up a huge bloated interface, as far as possible to refine the interface, the interface of the method as little as possible.
5, Dimitri Law: low coupling, cohesion poly.
6, open and close principle: a software entity such as classes, modules and functions should be opened to the extension, the modification is closed.
7. Combination/Aggregation multiplexing principle: Use combination and aggregation sparingly and use inherited relationships to achieve the principle of reuse.
Java Design Patterns (1) Seven Principles of--java design pattern