RationalDB 





UML   «Prev  Next»

Modeling Aggregation and Composition:

This page defines the notation for specifying aggregation and composition associations.
Notation for specifying aggregation and composition associations in UML  RationalDB
Lesson 8 Modeling Aggregation and Composition
Objective Define the Notation for specifying aggregation and composition associations.
Aggregation is a special type of association used to indicate that objects are assembled together to create a new object. For example, a number of different parts are assembled to create a car, a boat, or a plane.
Aggregation
Aggregation Composition Modeling
To identify aggregation, use a diamond on the end of the association attached to the aggregate class and attach the other end of the association to the component class. Remember to assign the appropriate multiplicity to each end of the association.
In most cases, the multiplicity at the aggregate end is one, so many people do not bother to set this value.
Aggregation
Composition
The UML has a new form of association called composition. Composition is used for aggregations where the life span of the parts depends on the life span of the aggregate. To indicate composition, simply make the diamond black.

Aggregation and composition
In the graphic above, the team example uses aggregation. A team is composed of players. But if the team is disbanded, the players live on. The book example uses composition because a book is composed of chapters. If the book is destroyed, the chapters are destroyed as well.
In the next lesson, you will learn about composition context.
Model Aggregation Composition Associations - Exercise
Click the Exercise link below to model aggregation and composition associations.
Model Aggregation Composition Associations - Exercise

UML Aggregation Composition - Quiz
Now click the Quiz link below to take a short multiple-choice quiz on aggregation and composition.
UML Aggregation Composition - Quiz