Association or Aggregation?

I l @ ve RuBoard

If two classes are tightly bound by a whole-part relationship, the relationship is typically an aggregation. "The decision to use aggregation is a matter of judgment and is often arbitrary. Often it is not obvious if an association should be modeled as an aggregation. If you exercise careful judgment and are consistent, the imprecise distinction between aggregation and ordinary association does not cause problems in practice." [1]

[1] Rumbaugh, James et al. Object-Oriented Modeling and Design . Upper Saddle River, NJ: Prentice Hall, 1991, p. 58.

Whether a relationship is an association or an aggregation is often domain dependent. What type of relationship should be used to model a car with its tires? If the application is a service center, and the only reason you care about the tire is because it is part of the car you are servicing , then the relationship should be an aggregation. On the other hand, if the application is a tire store, you will care about the tire independent of a car and therefore, the relationship should be an association.

I l @ ve RuBoard

Visual Modeling with Rational Rose 2002 and UML
Visual Modeling with Rational Rose 2002 and UML (3rd Edition)
ISBN: 0201729326
EAN: 2147483647
Year: 2002
Pages: 134

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: