2. UML related knowledge - 1
2
Association
The most abstract way to describe relationship between classes
A kind of link between two classes or more
Any relationship between object of two classes
3. UML related knowledge - 2
3
Weak Association (Dependency)
If class A’s methods include parameter of Class B’s reference, or
returns reference of Class B, it calls A depends on B.
Strong Association
If class A holds class B’s reference, it calls A have strong
association with B.
4. UML related knowledge - 3
4
Aggregation (Association with part/whole relation)
A part of relationship between Class A (whole) and Class B (part)
Also called shared association
Doesn’t state in any way that Class A owns Class B nor that
there’s a parent-child relationship between the two
5. UML related knowledge - 4
5
Composition (Association with strong life cycle relation)
A strong life cycle dependency between the two, meaning that
when Class A is deleted then Class B is also deleted as result.
Also called not shared association.
Use more specific composition link instead of the aggregation
link or association link.
Editor's Notes
因為菱形也有可能是空的 因此在 Static 的圖上有雖然有 Member Field, 但有可能是空的 Aggregation: has a