OOPortal OOPortal


Logical View  «Prev 

Composite Aggregation is a Filled Diamond

Composite aggregation, or composition, means that the part is a member of only one composite object, and that there is an existence and disposition dependency of the part on the composite.For example, a hand is in a composition relationship to a finger.
In the Design Model, composition and its existence dependency implication indicates that composite software objects create (or caused the creation of) the part software objects (for example, Sale creates SalesLineItem). But in the Domain Model, since it does not represent software objects, the notion of the whole creating the part is seldom relevant (a real sale does not createa real sales line item). However, there is still an analogy. For example, in a "human body" domain model, one thinks of the hand as including the fingers, so if one says, "A hand has come into existence," we understand this to also mean that fingers have come into existence as well. Composition is signified with a filled diamond. It implies that the composite solely owns the part, and that they are in a tree structure parts hierarchy; it is the most common form of aggregation shown in models.
For example, a finger is a part of at most one hand, thus the aggregation diamond is filled to indicate composite aggregation (see Figure 4-9).

1. Recall that each end of an association is a role, and that a UML role has various roperties, such as multiplicity, name, navigability and isAggregate.
Figure 4-9 Composite aggregation.

Book Composition Image Gallery

Start with the Book context. Draw the box and place the name at the top.

Place the Chapter context inside of the Book context to show containment. Name the new component context and place the multiplicity in the top right corner.

Place the Footnote context inside the Chapter context to show containment. Place the multiplicity in the top right corner of the Footnote context.

A Footnote may refer to another Chapter in the same book. Draw the association line from the edge of the Footnote out of the Chapter context and back to the outside edge of the Chapter context and back to the outside edge of the Chapter context. The association line goes outside of the Chapter context in which the Footnote resides.

Footnotes can also refer to Chapters in other Books. Draw the association line from the outside edge of the Footnote, out of the Chapter and the Book context, then back inside the Book context to the outside edge of the Chapter context. The association goes outside of the context of the current Book and back in to another Chapter inside another Book.

A Footnote can refer to the Book in which it resides. Draw the association line from the Footnote to the inside edge of the Book context. The association does not go outside of the current Book context, but rather remains inside the context of the current Book.