Book a Demo

Author Topic: Toolbox with directed Composition?  (Read 13124 times)

koenemann

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Toolbox with directed Composition?
« on: May 26, 2014, 07:33:49 pm »
Hi!

By default, a composition added between two classes looks like this (the diamond should be filled):

[ClassA] <>----- [ClassB]

It is a little bit weird, but direction is added as desired by setting changing the 'Direction' property of the composition from 'Source -> Destination' to 'Destination -> Source':

[ClassA] <>----> [ClassB]

But I would like to have it directed by default.
So I tried to created an MDG technology with a profile that defines a composition that is already directed (by adding an attribute: 'direction : Direction = Destination -> Source'), then I added a toolbox and diagram type with this new composition.

But when installing the MDG technology and creating a new composition, there it is still a composition with default direction 'Source -> Destination'.

So my question is: how can I define a toolbox with a composition that is directed by default?
Btw, using EA v10.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Toolbox with directed Composition?
« Reply #1 on: May 26, 2014, 09:02:35 pm »
EA is a *bit* wishy washy in that respect. There's also a global option Tools/Options/Links/Assoc. def (2nd) and /Draw Aggr. rev. (5th)
There are reasons for those options to be present. However, it doesn't make the behavior more clear or stringent.

q.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Toolbox with directed Composition?
« Reply #2 on: May 27, 2014, 09:07:55 am »
I would create a stereotype that extends Association, and set the direction attribute to "Source -> Destination" and the compositionKind attribute to "Composite at Source".
The Sparx Team
[email protected]

koenemann

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Toolbox with directed Composition?
« Reply #3 on: May 27, 2014, 05:09:43 pm »
Great, it works! Thank you very much KP!
Are these customizations (like "Composite at Source") documented somewhere?

In the meantime I have a very similar problem:
I would like to create enumeration literals from the toolbox, but a stereotype for properties always creates normal attributes without the 'Is Literal' flag. Is it possible to create enum literals from the toolbox?

Quote
I would create a stereotype that extends Association, and set the direction attribute to "Source -> Destination" and the compositionKind attribute to "Composite at Source".


@qwerty: the option for reverse aggregation draws compositions/aggregations the other way, but it does not change add arrows for indicating the direction/navigability. So this is not what I was looking for.