Class Association and association
Several relationships in a UML class diagram:
1. Association
(1) the association relationship is the connection between the class and the class, which makes one class know the attributes and methods of the other class.
(2) the association can be bidirectional or unidirectional. Two-way association can have two arrows or no arrows, and one-way Association has one arrow.
(3) In Java or c ++, associations are implemented by using member variables.
Class A {} class B {public A a {get; set ;}}
Note:You can use attributes to know the attributes and methods of another class instance.
2,Aggregation)
1. An aggregation relationship is a strong association relationship.
2. Aggregation is the relationship between the whole and the part. For example, an automobile consists of an engine, a tire, and other parts.
3. The aggregation relationship is also implemented through member variables. However, the two classes involved in the Association are at the same level, while the two classes in the aggregation relationship are at different levels. One Class represents the whole, and the other class represents the part.
4. Association and aggregation cannot be distinguished only from Java or C ++ syntax, and the logical relationship between classes involved must be investigated.
From: http://www.uml.org.cn/oobject/201012233.asp