Design Principles: 2. Stability: The principle of coupling of the package (1) Unconventional dependence principle ??? It is very good to understand that there is no ring in the relationship of the package, otherwise waiting for the drama, such as the morning syndrome How to relieve the dependency ring? Very simple! Principles using DIP (dependencies) (2) Stable dependence principles??? What is stability? Stability and changes needed, such as erect coins are unstable, but the table is stable. If there is a lot of packages depend on the package X, then x is stable ??? Stability metrics: i = Ce / (Ca CE) CA is an input coupling degree, CE is an output coupling degree ??? One package I value should It is greater than the I value of the package that it rely on, that is, the I value should be reducing the direction of dependencies. In a software system, some parts do not change often, it represents the system's high-level architecture and design strategy, should it be ??? Put these parts in the most stable package (3) Stable abstract principle ??? The abstraction of the package should be consistent with the stability
The structure of the package cannot be designed from the top, and the package structure is gradually evolved with the system, and the relationship between the bags and the application's function is almost indispensable. They are the application-can-constructive mapping map ( I heard this kind of saying is not very understood)