Association or Aggregation?

I’ve been discussing with my co-workers when we have to use Aggregation or Association in UML models. Martin Fowler in UML Distilled, 3rd Edition says aggregation is the part-of relationship. It’s like saying that a car has an engine and 4 wheels as its parts. But aggregation was included in UML to differentiate from association, because in pre-UML days people didn’t knowhow to differentiate them. But aggregation, as Fowler says, is meaningless. Jim Rumbaugh says “Think of aggregation as a modeling placebo”. Association is a way to notate a property in our classes, but you don’t manage the life cycle of the associated property, as the aggregation relationship do. The solid line between the classes define the way one instance of the associating class can execute methods (operations realizations) of the associated object. So, why to use aggregation?

3 Replies to “Association or Aggregation?”

  1. What about Composition?

    When you say you don’t manage the life cycle of the associated property, as the aggregation relationship do, don’t you mean Composition ? IIRC, the link where you manage the lifecycle of the linked object is Composition.

    It’d be interesting to note the differences between Association, Aggregation and Composition.

  2. I personally use the aggregation notation in a sense to give a more important role to the side of the relation which holds the empty diamond. Drawing my UML sketches (the way I like more to use UML) I use it just like that, without any formal meaning, without worrying too much about it.

    The part-of meaning of it it’s just not that appealing to me.

Leave a Reply

Your email address will not be published. Required fields are marked *