Author Topic: Possible to inherit from stereotypes from within your own MDG or UML Profile?  (Read 300 times)

Jayson

  • EA User
  • **
  • Posts: 271
  • Karma: +1/-0
    • View Profile
Hey all

So the Sparx documentation shows that its possible to:

* Inherit from another existing technology (demonstrated using the extension of SysML1.3::block.
* Inherit from another profile (demonstrated using extension of TOGAF::Principle).

However, can I inherit from Stereotypes that are:

1. In the same profile as I am developing?
2. In a different profile in the same MDG as I am developing?


I would note however that TOGAF::Principle isn't just in another profile but like SysML1.3 is is in another technology.
So why is this implemented differently in the example?

In the case of SysML1.3::block, the example uses a metaclass block to redefine it.
In the case of TOGAF::Principle, it uses a Stereotype (with the same fully qualified name) to redefined it.

What gives???

Cheers :-)

Jayson

  • EA User
  • **
  • Posts: 271
  • Karma: +1/-0
    • View Profile
Sorry, one more point.
I am trying to replicate the "Redefine Stereotypes in Another Profile" example (i.e. redefining TOGAF::Principle) as shown on page 30 of the MDG technologies user guide (version 1.0).
However, I can't get this to work.

I should point out that when the example states to set the stereotype of the Generalization to "redefines" I cannot find such a stereotype and am therefore creating a NEW stereotype called "redefines". I am wondering if this is what is going wrong and where can I find this stereotype.

Cheers

Jays :-)

qwerty

  • EA Guru
  • *****
  • Posts: 11738
  • Karma: +322/-274
  • I'm no guru at all
    • View Profile
There's a recent thread (started by Paolo) about inheritance in profiles. You might search for that. Generally you can inherit from any profile. When doing so, this profile must be present when deploying your inherited stereotype.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10899
  • Karma: +387/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Both cases are the same. Both he TOGAF::Principe as the SysML1.3::block are stereotypes, both from another MDG.

Yes, I believe I had to create the redefines stereotype as well.

Important when redefining is to make sure you set your MDG as "active"

Geert

Jayson

  • EA User
  • **
  • Posts: 271
  • Karma: +1/-0
    • View Profile
Cheers. Pretty sure is active but will look again.
Will this work for stereotypes in a different profile in the same mdg?
How about stereotypes in the same profile?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10899
  • Karma: +387/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Why would you want to redefine a stereotype from the same MDG or the same profile?
That doesn't make sense because you can simply change the existing stereotype.

If you want to create a specialized stereotype you can do that with the fully qualified stereotype name when the parent stereotype is in another profile.
In the same profile you can use the actual stereotype element as the target of the generalization.

Geert

Jayson

  • EA User
  • **
  • Posts: 271
  • Karma: +1/-0
    • View Profile
Sorry Geert

Yes, I want to extend (not redefine) existing stereotypes in the current profile so that I can have sub-types based on a common parent type. You'd never guess English is my 1st language huh? ;)

How do I do this? I cannot find it in the documentation. Do you have a link?

Also, what is inherited? (i.e. tags, tag groups? shape scripts?) and what can you override?

Cheers :-)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10899
  • Karma: +387/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
to extend an existing stereotype you use a Generalization connector.

To the "real" stereotype if it's a stereotype from the same profile.
To the fully qualified proxy is it's a stereotype from another profile (regardless of MDG)

I think you inherit about everything, but you should test for yourself to be sure.

I did notice that I needed an extend relation to the metaclass in order to get the toolboxes to function.
That is no longer required according to the manual, but I couldn't get it to work without.

Geert


Jayson

  • EA User
  • **
  • Posts: 271
  • Karma: +1/-0
    • View Profile
Thanks Geert!
I will have a play tomorrow (it is late here) and report back if I find anything else interesting.

In the meantime, dun suppose you know the answer to the tag grouping question I asked Eve do you?
The tag groups can be different for each metaclass that a Stereotype realises, but when it doesn't seem to translate into the MDG.

In fact if they are different on different metaclasses, it seems that the groups stop working altogether.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10899
  • Karma: +387/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Thanks Geert!
I will have a play tomorrow (it is late here) and report back if I find anything else interesting.

In the meantime, dun suppose you know the answer to the tag grouping question I asked Eve do you?
The tag groups can be different for each metaclass that a Stereotype realises, but when it doesn't seem to translate into the MDG.

In fact if they are different on different metaclasses, it seems that the groups stop working altogether.
No, I never tried different groupings on different metaclasses

Geert

Jayson

  • EA User
  • **
  • Posts: 271
  • Karma: +1/-0
    • View Profile
Oh well, I will play with all the variations of that tomorrow and report back too.
Thanks for the help :-)

Jayson

  • EA User
  • **
  • Posts: 271
  • Karma: +1/-0
    • View Profile
Ok, so the problem I was having with redefining the stereotype was as you described with needing to add a metaclass in order to get the toolbox profile helper to recognise it.

For what its worth, you CAN get around this artificial need by directly adding the toolbox item to the XML file although I am not sure of any benefit since Sparx appears to create the correct metatype regardless of the metatype you choose to extend from although it DOES seem to matter if you specify a connector or element metatype.

Cheers :-)