Reference: http://blog.csdn.net/qq_34134078/article/details/51780356
1. Single principle
That is, define the definition of the class. In layman's terms, let them do only one thing, not many things.
Improve the readability of the class, better maintenance, reduce the coupling degree. Of course, the method, the variable is also the case.
2. The Richter replacement principle
A. Subclasses can implement an abstract method of a parent class, but cannot overwrite a non-abstract method of the parent class.
B. Subclasses can add their own unique methods.
Consequences of non-compliance: the chance of writing code is greatly increased.
3. Dependency Inversion principle
High-level modules should not rely on the underlying modules, both should be dependent on abstraction. Detail is dependent on abstraction. Abstraction should not depend on detail.
4. Dimitri Law
Definition: An object should have minimal knowledge of other objects.
The closer the relationship between classes and classes, the greater the coupling, and the greater the impact on the other class when one class changes, thus minimizing the degree of coupling between classes and classes.
Unity3d Basic design Development principles (improved code readability)