Update associations authored by Christian Zirkelbach's avatar Christian Zirkelbach
......@@ -4,17 +4,22 @@
An Association classifies a set of tuples representing links between typed instances, e.g., two instances of classes at runtime.
## Example
![Binary Association Class Diagram](https://git.informatik.uni-kiel.de/ag-se/teaching-public/wikis/uml-sources/img/binary-association.png)
# Aggregation vs Composition
![Association Class Diagram](https://git.informatik.uni-kiel.de/ag-se/teaching-public/wikis/uml-sources/img/association.png)
# Aggregation and 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:
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: Lecture (parent) and Student (child). Delete the Lectureand the Students still exist.
## Aggregation
Aggregation implies a relationship where the child can exist independently of the parent. Example: Lecture (parent) and Student (child). Delete the Lectureand 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.
### Example
![Aggregation Class Diagram](https://git.informatik.uni-kiel.de/ag-se/teaching-public/wikis/uml-sources/img/aggregation.png)
## Example
## Composition
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.
### Example
![Composition Association Class Diagram](https://git.informatik.uni-kiel.de/ag-se/teaching-public/wikis/uml-sources/img/composition.png)
The example contains a class person (parent) with the (child) classes head, leg, and heart.
\ No newline at end of file