11/17/2012

Association Versus Compositional Aggregation

It seems rather hard to find a one-sheet paper that describes the relationship between association and compositional aggregation that includes both UML diagrams and code. This is why I have decided to make one. Recall that an object A is associated to an object B, if A contains an object reference to B. References to B may exist outside A.

If A compositionally aggregates B then A is associated to B and furthermore if A is destroyed, so is B. We see that compositional aggregation puts an additional requirement on the references in question.