Single principle of responsibility
In fact, developers often say, "high cohesion, low coupling"
In other words, each class should have only one responsibility, and only one function can be provided externally, and the cause of the class change should only be the same. In design mode, all design patterns follow the principle
Opening and closing principle
The core idea is: an object to expand open, to modify the close
In fact, the opening and closing principle means that changes to the class are made by adding code, not by modifying the existing code.
In other words, once the software developer writes out the code that can be run, it should not change it, but to ensure that it can continue to run, how can this be done? This requires abstraction and polymorphism, that is, to abstract the content that is likely to change, so that the abstract part is relatively stable, and the concrete implementation can be changed and extended
Lee's replacement principle:
The core idea: where any parent class appears, it can be substituted with its subclasses
In fact, it is said that the objects in the same inheritance system should have common behavioral characteristics.
Core injection principles:
Core idea: To rely on abstraction, do not rely on concrete implementation
In fact, in an application, all classes, if the goods depend on other classes, should rely on the abstract classes of those other classes, not the concrete classes of those other classes. In order to implement this principle, we are required to program at the time of programming for the abstract class or for the deduction, rather than for the specific implementation of the programming
Interface Separation principle:
Core idea: The program should not be forced to rely on methods that they do not need to use
In fact, it is said: an interface does not need to provide too much behavior, an interface should be provided only an external function, should not be all the operations are encapsulated in a connector
Dimitri Principle:
Core idea: An object should know as much as possible about other objects
In fact, it is said: reduce the coupling between the various objects, improve the maintainability of the system. Between the modules should only be programmed through the interface, regardless of the internal workings of the module, it can reduce the coupling of the Brother module to a minimum, promote the reuse of software
Principle of object-oriented thought design