Aggregation
Last updated
Last updated
Aggregation is a special form of association in UML that represents a whole-part relationship between Classes, where the part can exist independently of the whole. In Modeldraw, you can use Aggregation relationships to model these looser "has-a" connections in your system design, showing how objects are composed of or contain other objects without implying ownership.
Aggregation represents a weak "has-a" or "consists of" relationship between classes. Key characteristics include:
The part (contained object) can exist independently of the whole (container object)
If the whole is destroyed, its parts are not necessarily destroyed
A part can belong to multiple wholes simultaneously
The whole references its parts, but doesn't manage their lifecycle
Aggregation is represented in UML by a solid line with an unfilled (hollow) diamond at the end of the whole (container) class.
Examples of aggregation:
A Library (whole) and Books (parts)
A Department (whole) and Employees (parts)
A Playlist (whole) and Songs (parts)
Aggregation differs from Composition, which is a stronger form of association where the part cannot exist independently of the whole. It's also different from a simple Association, as it implies a more specific whole-part relationship.
To create an Aggregation relationship in Modeldraw:
Select the Aggregation tool from the toolbox
Click on the part (contained) Class
Move above and click the whole (container) Class
The hollow diamond will automatically appear at the end of the whole class, indicating the whole-part relationship.