An aggregation is a special form of association used to express that a class is part of another class, properties of the aggregation association include:
- transitive: if is part of and is part of , is also part of
- asymmetric: it is not possible for to be part of and to be part of at the same time
There are two types:
Shared Aggregation (UML Class)
A shared aggregation expresses “a weak belonging of the parts to a whole” where parts also exist independently of the whole. Multiplicity at the aggregating end may be hence one element can be part of multiple other element at the same time. Syntax is a hollow diamond at the aggregating end.
For example, take that:
- a Student is part of LabClass
- a Course is part of StudyProgram
Link to original
Composition (UML Class)
A composition is an existence dependency between the composite object and its parts. One part can only be contained in at most one composite object at one specific point in time. Multiplicity at aggregating end is at maximum 1, the composite objects form a tree.
If the composite object is deleted, its parts are also deleted. Syntax: solid diamond at the aggregating end.
For example, a Beamer is part of LectureHall which is part of Building.
Link to original