|
|
|
**Sources:** http://www.omg.org/spec/UML/2.5 (Starting at PDF page 239)
|
|
|
|
|
|
|
|
# Associations
|
|
|
|
An Association classifies a set of tuples representing links between typed instances, e.g., two instances of classes at runtime.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Aggregation vs Composition
|
|
|
|
|
|
|
|
Aggregation and Composition are subsets of associations meaning they are specific cases of association.
|
|
|
|
In both aggregation and composition object of one class "owns" object of another class. But there is a subtle difference:
|
|
|
|
|
|
|
|
* Aggregation implies a relationship where the child can exist independently of the parent. Example: Class (parent) and Student (child). Delete the Class and the Students still exist.
|
|
|
|
|
|
|
|
* Composition implies a relationship where the child cannot exist independent of the parent. Example: House (parent) and Room (child). Rooms don't exist separate to a House.
|
|
|
|
|