Aggregation or composition relationships are used if an object of one class is contained in an object of another class.
They are drawn as a line with a diamond at the end of the containing class. A composition relationship’s diamond is filled; an aggregation’s diamond is not.
The difference between these two kinds of relationships is as follows: The contained element in a composition relationship is a part of the containing element: If the containing element is deleted, the contained element no longer exists. Therefore, composition means an object may only be contained in one other object.. An aggregation relationship is one of shared objects. This means, multiple objects may aggrgate the same object. By consequence, an aggregated object still exists, even if the aggregating object is deleted
If the PERSON no longer exists, nor do the feet. In contrast, a PERSON may also have a lot of COATs. However, a COAT may generally be used by multiple PERSONs and its life-cycle is generally independent of the life-cycle of its wearers.
An association relationship has weaker semantics than the composition relationship. Here, both objects have “equal
rights”. An association relationship opens visibility onto the attributes of the related objects. Figure 9 gives an example of an association. In an association objects of one class may be related to one or more objects of the other class. To restrict the number of associations of the same type between two classes, cardinalities are used in the same way as for compositions.
An Association class is a hybrid of an association and a class. Generally, they can be interpreted as an association carrying its own attributes (and methods). They are drawn like an association with a class symbol being connected to the centre of the association line with a dashed line
{xor} constraint: It enforces that an instance of one class has a relationship with instances of one or the other associated class but never both at the same time.
In this paragraph, a very short idea of how the UML model is mapped onto XML language elements is given. It does not claim do be complete