Book a Demo

Author Topic: Aggregate vs. Association  (Read 5731 times)

Stringer

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Aggregate vs. Association
« on: September 10, 2007, 09:43:09 am »
If I draw quick connection between two classes I get different results for normal Association and Aggregate types.

I mean when I draw Association from class B to class A, it will draw the arrow to direct at the A class. I assume that means the A is the parent class. Or that the A class is needed to satisfy the B class but not vice versa.

Now if I draw Aggregate from class B to class A, it will draw the diamond to point at the B class. I assume that means that the B is the parent class. Or that the B class is needed to satisfy the A class but not vice versa.

According to the tutorial the diamond should be directed at the parent class. Why are these connections behaving differently?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Aggregate vs. Association
« Reply #1 on: September 10, 2007, 10:57:37 am »
Quote
If I draw quick connection between two classes I get different results for normal Association and Aggregate types.

I mean when I draw Association from class B to class A, it will draw the arrow to direct at the A class. I assume that means the A is the parent class. Or that the A class is needed to satisfy the B class but not vice versa.

Now if I draw Aggregate from class B to class A, it will draw the diamond to point at the B class. I assume that means that the B is the parent class. Or that the B class is needed to satisfy the A class but not vice versa.

According to the tutorial the diamond should be directed at the parent class. Why are these connections behaving differently?

To answer your last point first, not quite. UML requires that the class with the diamond end be the 'owner' of the other class. Tool makers were required to implement the relationship in this fashion, but were given no explicit directions regarding how a user would actually 'draw' such an association. Thus, some (most?) tools do it the way EA does, while others do it the other way.

If you are used to tools that draw aggregations the 'other' way (or if you would simply prefer it that way) then go to the Tools | Options | Links dialog and check the Draw Aggregations Reversed box. EA will switch how it interprets this drawing action and remember the setting.

As for your first assumption, the actual meaning of the arrows relates to navigability. That is, the class on the (or perhaps either) point of the arrow can be seen (i.e. referenced directly) by the class on the other end.

HTH, David
No, you can't have it!

Stringer

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Aggregate vs. Association
« Reply #2 on: September 10, 2007, 11:14:47 am »
Looks like that box was pre-selected. Now it works better.