Composition association relationships

A composition association relationship represents a whole–part relationship and is a form of aggregation. A composition association relationship specifies that the lifetime of the part classifier is dependent on the lifetime of the whole classifier.

In a composition association relationship, data usually flows in only one direction (that is, from the whole classifier to the part classifier). For example, a composition association relationship connects a Student class with a Schedule class, which means that if you remove the student, the schedule is also removed.

You can name any association to describe the nature of the relationship between the two classifiers; however, names are unnecessary if you use association end names.

As the following figure illustrates, a composition association relationship appears as a solid line with a filled diamond at the association end, which is connected to the whole, or composite, classifier.

Two classes, Student and Schedule, are joined by a composition association relationship.


Feedback