Book a Demo

Author Topic: Profiles: Stereotype inheritance  (Read 5004 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Profiles: Stereotype inheritance
« on: February 17, 2009, 07:41:57 pm »
Hey beveryody,


I'm working on a Profile and I'm wondering if what I'm experiencing is as it should be.

First off, I create two abstract Stereotypes MyStereo and MyTag which <<extend>> Class, then add four concrete Stereotypes MyStereoA and MyStereoB which Generalize MyStereo, and MyTagA and MyTagB which Generalize MyTag.
I then want MyStereoA to have a tag of type MyTagA, and MyStereoB to have a tag of type MyTagB. I can do this - but the tags cannot have the same name (MyTag). I must name them differently, eg aMyTag and bMyTag.

Secondly, I can specify that a Stereotype should be composite (_makeComposite, _defaultDiagramType) - but if I do that on the abstract MyStereo, the concrete MyStereoA and MyStereoB are not made composite when dragged in from the Resources tab.

Are these bugs or am I UMLing wrong?

Cheers,


/Uffe
My theories are always correct, just apply them to the right reality.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Profiles: Stereotype inheritance
« Reply #1 on: February 18, 2009, 09:50:32 am »
Quote
I then want MyStereoA to have a tag of type MyTagA, and MyStereoB to have a tag of type MyTagB. I can do this - but the tags cannot have the same name (MyTag). I must name them differently, eg aMyTag and bMyTag.
Yes, I'm afraid tag names must be unique at the profile level.

Quote
Secondly, I can specify that a Stereotype should be composite (_makeComposite, _defaultDiagramType) - but if I do that on the abstract MyStereo, the concrete MyStereoA and MyStereoB are not made composite when dragged in from the Resources tab.
EDIT: see Simon's answer below. Rightly or wrongly, _makeComposite and _defaultDiagramType aren't inherited. You will need to add them to all subclasses that need them (which is pretty easy: just drag and drop from the project browser).
« Last Edit: February 19, 2009, 08:56:23 am by KP »
The Sparx Team
[email protected]

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Profiles: Stereotype inheritance
« Reply #2 on: February 18, 2009, 07:49:27 pm »
Hi again,

Thanks for that.

Quote
Yes, I'm afraid tag names must be unique at the profile level.
Well, not unique unique. I can reuse the same name for tags in different stereotypes, just not stereotypes with a common ancestor. Or is it because in the former case, my <<taggedValue>> connectors actually point to the same stereotype too, while in the latter they point to different stereotypes with a common ancestor? I'll leave that as an exercise for the reader. ;)
Either way, I can make the profile work so it's no biggie.

Quote
Rightly or wrongly, _makeComposite and _defaultDiagramType aren't inherited. You will need to add them to all subclasses that need them (which is pretty easy: just drag and drop from the project browser).
Weerrlll...

If I try to add the attributes to the stereotype itself, they come out as tags in the imported profile. Instead, I have to remove the <<extends>> from the abstract stereotype and make each concrete stereotype <<extend>> the metaclass. (If I retain the <<extends>> from the abstract stereotype I end up with two copies of each concrete one.)
This makes the profile diagrams a bit messy but again, it works.
My theories are always correct, just apply them to the right reality.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Profiles: Stereotype inheritance
« Reply #3 on: February 19, 2009, 07:57:13 am »
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/creating_composite_elements.html

Quote
The _makeComposite attribute is applied to a metaclass element, not a stereotype element.