1, open and close principle (OCP): Refers to the "software entity should be opened to the extension, the modification closed", is the basis of all design principles, we can simply understand that we can add the class according to the new requirements and do not modify the original class.
2. Single responsibility Principle (SRP): "For a class, there should only be one cause of its change", the simple understanding is that a class only completes its own responsibility not to prepare redundant duties, so that it conforms to the "high cohesion low coupling" standard.
3, the Richter substitution principle (LSP): "If the object of each type S is O1, there is an object of type T O2, so that all program P defined in T in all objects O1 substitution O2, the behavior of the program P does not change, then the type S is the subtype of type T", The simple understanding is that in a software you can replace the base class with subclasses, and the program will not go wrong, and vice versa. We use the base class to define the object as much as possible, while at run time we can use the subclass object instead of the base class object.
4, one-switching principle (DIP): refers to the "definition of a: high-level modules should not be dependent on the lower modules, both should be dependent on abstraction." Abstractions should not be dependent on detail, and details should be based on abstraction ", simple to understand that when designing a system, we need to use abstraction to analyze it without having to focus on the details of the class at first. "Definition two: to programming for the interface, not to implement programming", simple understanding, we use the dependency switching principle, we can through the interface and abstract classes of variables, parameters, methods and other declarations. Also, the implementation class is forbidden to do all the above declarations.
5, the Interface Isolation principle (ISP): Refers to "one class to another class dependency should be built on the smallest interface", simple understanding is the interface of the expression to be accurate, do not wear a redundant method.
6, Dimitri Law (LKP): Refers to "an object should have the least possible understanding of other objects, do not have to contact people who do not know directly."
Java Web Design Pattern Learning