Dependent Dependency
Class car{}class person{ int A; static int b public void Buy (Car c) { int c; .... }}
A class is a parameter of a method that has a class, or a local variable, or a static method call, and so on.
In addition, there are two kinds of variables: local variables, member variables.
The variable defined in a method is a local variable, such as the above C.
Called member variables, which are defined directly in the class, are also divided into two instance variables, class variables
The instance variable is the above a
The class variable is the above B;
The following three scenarios
Associating, aggregating, combining three relationships, there is no difference in code, and many of us are semantically differentiating them from each other.
Association Association
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvzgxmmtizmzix/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/center ">
Class student{}class teacher{ list<stundet> stulist;}
A class is a member variable that also has a class
Polymerization aggregation
Aggregations and associations are syntactically consistent.
Just, the class involved in the association is logically a level, such as the student teacher above, but the aggregation involves the class is not a level.
Look at the following example:
It can be expressed as a has a/some B, at which point B is able to separate from a and exist independently. Without a car tire or a tire.
Combination composition
The composition relationship is a bit tighter than the aggregation relationship
The limbs and the people are die.
Non-separable.
As for generalization (generalization) and implementation (realization), we are most often talking about inheritance extends and implementation implements. There's nothing to say.
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
UML Simple Comb class diagram