Book a Demo

Author Topic: Composition and Aggregation in Class Diagram?  (Read 4704 times)

Kimpan

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Composition and Aggregation in Class Diagram?
« on: July 19, 2006, 02:03:47 am »
Hi

I just downloaded EA to try it out and wonder about the direction of 'Compose' and 'Aggregate' connection types (Using Toolbox->Class)

It seems to me that the direction of these types should be in the opposite direction according to UML 2?

When I try to describe 'A contains B' using composition relationship, I get connector drawing opposite to what I am familiar with. But the textual description is what I intended.

And how do I get an arrow to the destination (part) ?
« Last Edit: July 19, 2006, 02:08:57 am by Kimpan »

Kimpan

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Composition and Aggregation in Class Diagram?
« Reply #1 on: July 19, 2006, 04:33:08 am »
Oh, I found the solution in the Forum in the topic "UML to C# correspondence"

Although I wonder why it is reversed from UML 2 as default?

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
« Last Edit: July 19, 2006, 04:13:39 pm by sargasso »
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Composition and Aggregation in Class Diagram?
« Reply #3 on: July 19, 2006, 04:17:54 pm »
Quote
Although I wonder why it is reversed from UML 2 as default?


It isn't. UML 2 doesn't care what direction you move the pen in drawing any connector.
The Sparx Team
[email protected]

Kimpan

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Composition and Aggregation in Class Diagram?
« Reply #4 on: July 20, 2006, 04:00:33 am »
Thanks for the info

Could you also tell me how to get an arrow on the destination end of the composition/aggregation?

Jan ´Bary´ Glas

  • EA User
  • **
  • Posts: 408
  • Karma: +0/-0
  • Bary
    • View Profile
Re: Composition and Aggregation in Class Diagram?
« Reply #5 on: July 20, 2006, 07:17:56 am »
Aggregation (Composition) Properties - Direction: Destionation -> Source
Jan 'Bary' Glas

Kimpan

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Composition and Aggregation in Class Diagram?
« Reply #6 on: July 23, 2006, 03:46:27 am »
Doesn't your suggestion make the dependency go in the opposite direction? I want the dependency to be source->destination, but then I don't get the arrow at the destination end.

I would like to follow the arrows in dependency chains to see what can be reused freely or not and which components need to be stable and so on.

I would also like to see UML 2.0 to incorporate the display of bidirectional associations with arrows on both ends. But who wants it except myself?  :)
« Last Edit: July 23, 2006, 03:47:55 am by Kimpan »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Composition and Aggregation in Class Diagram?
« Reply #7 on: July 23, 2006, 04:38:20 am »
Quote
Doesn't your suggestion make the dependency go in the opposite direction? I want the dependency to be source->destination, but then I don't get the arrow at the destination end.

I would like to follow the arrows in dependency chains to see what can be reused freely or not and which components need to be stable and so on.

I would also like to see UML 2.0 to incorporate the display of bidirectional associations with arrows on both ends. But who wants it except myself?  :)
Hi Kimpan,

Did you read the posting (of mine) that bruce mentioned about 5 posts ago?

If you use EA Associations instead of EA Aggregations you have complete control over every aspect of the rendering, including arrows at both ends (if you so desire).  UML allows that.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Kimpan

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Composition and Aggregation in Class Diagram?
« Reply #8 on: July 23, 2006, 01:12:20 pm »
Yes I read it and it works as I intended when I use 'Associate' instead of 'Compose' or 'Aggregate'. What I wonder was if there is another, faster way to get composition looking the way I am used to.

But it's ok, although it would be nice to be able to customize 'Compose' and 'Aggregate' to the way I prefer.