UML Aggregation

64
rate or flag this page

By umlnotes


whole/part relationship

Aggregation is a whole/part relationship. This relationship denotes that the aggregate class (the class with the diamond touching it) is in some way the “whole”, and the other class in the relationship is somehow “part” of that whole.

There is not likely to be much difference in the way that the two relationships, Aggregation or Association, are implemented. That is, it would be very difficult to look at the code and determine whether a particular relationship ought to be aggregation or association. For this reason, it is pretty safe to ignore the aggregation relationship altogether. As the amigos said in the UML 0.8 document: “...if you don’t understand don’t use it.”

The weak form of aggregation is denoted with an open diamond.
The weak form of aggregation is denoted with an open diamond.

Implementation in C++

class Window

{

public:

//...

private:

vector<Shape*> itsShapes;

};

Strong form of Aggregation

Strong form of Aggregation is Composition (black diamond).

Print   —   Rate it:  up  down  flag this hub

Comments

RSS for comments on this Hub

Cristi  says:
2 months ago

I think the difference between association and strong aggregation is in the ownership of the "part". In terms of the implementation, for example, if A has B (strong aggregation), then A is responsible for creating B. If between them is a simple association, then the creation and ownership is left to other entity.

Submit a Comment

Members and Guests

Sign in or sign up and post using a hubpages account.


optional


  • No HTML is allowed in comments, but URLs will be hyperlinked
  • Comments are not for promoting your hubs or other sites

working