Package and symbiotic
1. Level of packages:
a. Original code line: 0 level package;
B: The program is fast: 1 level package;
C: Class and Object Structure: Level 2 Package;
D: Package: Level 3 package.
E: Part: 4 packages.
The books involved in these five packages, but it is not difficult to imagine that the next package structure will continue this feature, that is, the abstraction will be getting higher and higher, the difficulty of design is also growing bigger (set to n Seal, the "object" structure and interaction thereof at the time of design, while also considering the design requirements of N-1 and the following levels, including interfaces, interactions, etc.).
2. Class design requirements
TO 0 level level 2 level 2
From
0-level structured program information output -----------
Level 1 internal coupling -----------
Level 2 ----------------------------------------------------------------------------------------------------------------------------------
3. Causes of packages
The package is caused by the symbiotics between code, programs and classes. Kind of symbiotic:
Static symbiotic:
The name is symbiotic: INT i; if I is changed to J, the reference to the variable i in the program becomes J.
Type symbiotic: If the above example, if it is changed to CHAR I, the type symbiosis is generated.
Constant symbiotic: If it is determined, set (0,0) longitude 0, latitude 0 is a reference, and then add the associated moving value, a constant is generated between the latitude latitude.
Algorithm symbiotic: Similar to constant symbiotics
Position symbiotic:
Dynamic symbiotic:
Performing symbiotic: The code must be performed in a certain order;
Synchronous symbiotic: time limit;
Numerical symbiotic: The limitations of algorithms, such as A, B, and C three numerical requirements for one triangle are arbitrary two and greater than the third (unregistered category);
Identify symbiotic:
Differential symbiotic: For example, in a program
INT i; int J. If you want to change I to J, in addition to considering the name of i, considering the difference symbiosis, you need to change J to other, then change I, or change I to other letters of non-J.
4. Symbix and package border
A system without encapsulation units will generate two issues:
A symbiotic flood
B confused which is true symbiotic, which is accidentally similar or coming (just looks like)
5. Symbiotic and maintenanceability
In order to improve system performance, symbiotic provides three guiding principles:
A By splitting the system into the package, the entire symbiotic (including difference symbiotic) is minimized
b Minimize any enrichment of the encapsulation boundary
C Maximize symbiotic in the package boundary
6. Example of symbiotic abuse
A C friend function
B unconstrained inheritance ·····
C Since the realization of the accident