Book a Demo

Author Topic: What does Generalizes do with Stereotypes?  (Read 8940 times)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
What does Generalizes do with Stereotypes?
« on: August 06, 2021, 04:07:35 am »
Heyo

If I define a stereotype (Class1) with two base stereotypes (Stereo1 & Stereo2) Sparx will only generalize one of these (see XML snippet below).
Class1 inherits the tagged values from both Stereo1 & Stereo2, so what differnece does generalize make?

<Stereotype notes="" name="Class1"  baseStereotypes="Stereo1 Stereo2" generalizes="Stereo1" cy="0" cx="0"/>

Cheers

Jays :-)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: What does Generalizes do with Stereotypes?
« Reply #1 on: August 06, 2021, 06:58:35 am »
I still think that multi-inheritance is evil. But wait for Paolo. He'll tell you something else :-)

q.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: What does Generalizes do with Stereotypes?
« Reply #2 on: August 06, 2021, 07:41:59 am »
Heyo

If I define a stereotype (Class1) with two base stereotypes (Stereo1 & Stereo2) Sparx will only generalize one of these (see XML snippet below).
Class1 inherits the tagged values from both Stereo1 & Stereo2, so what differnece does generalize make?

<Stereotype notes="" name="Class1"  baseStereotypes="Stereo1 Stereo2" generalizes="Stereo1" cy="0" cx="0"/>

Cheers

Jays :-)


I believe the generalizes attribute is no longer used; EA is only interested in the baseStereotypes attribute.
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: What does Generalizes do with Stereotypes?
« Reply #3 on: August 06, 2021, 08:30:54 am »
Heyo

If I define a stereotype (Class1) with two base stereotypes (Stereo1 & Stereo2) Sparx will only generalize one of these (see XML snippet below).
Class1 inherits the tagged values from both Stereo1 & Stereo2, so what differnece does generalize make?

<Stereotype notes="" name="Class1"  baseStereotypes="Stereo1 Stereo2" generalizes="Stereo1" cy="0" cx="0"/>

Cheers

Jays :-)


I believe the generalizes attribute is no longer used; EA is only interested in the baseStereotypes attribute.
(my emphasis)
That's been our experience.

@KP: We post-process our MDG after generation (for various reasons).  Could I remove the "generalises" attribute?

Paolo
« Last Edit: August 06, 2021, 08:35:20 am by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: What does Generalizes do with Stereotypes?
« Reply #4 on: August 06, 2021, 08:35:06 am »
I still think that multi-inheritance is evil. But wait for Paolo. He'll tell you something else :-)

q.
IIRC, we have up to 12 entries, at present, in the basestereotypes attribute for some metatypes... ;)

Correctly (perhaps systematically) "separating concerns" seems to be the key to getting it working well.

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

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: What does Generalizes do with Stereotypes?
« Reply #5 on: August 06, 2021, 09:46:11 am »
LOL! Thanks guys!
All hail multiple inheritance! ;-)

Now that I have successfully sucked up to Paolo, next question is:

1. What actually gets inherited from base stereotypes? Shape scripts, etc?
2. When you have mulitple inheritance, which base stereotype takes precedence?

Cheers :-)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: What does Generalizes do with Stereotypes?
« Reply #6 on: August 06, 2021, 01:28:54 pm »
Hi Jays,
You may wish to take cognisance of the v15.2 – Specific stereotyped relationship obliterates more general thread (if you haven't already) where some of these topics are explored.
LOL! Thanks guys!
All hail multiple inheritance! ;-)

Now that I have successfully sucked up to Paolo, the next question is:

1. What actually gets inherited from base stereotypes? Shape scripts, etc?
  • Shapescripts (with the proviso that "shapes" overwrite, decorations are additive).  Thus we use inheritance as a form of composition.  We're trying to get to the point that the "leaf" metatype's shapescript is a composite of the shapescript fragments that it "inherits".
  • Tagged Value Properties
  • User Specified/Selected Diagram Properties (USDPs) are not, currently, inherited, but (I believe) Sparx have acknowledged is a bug.  We automagically inherit via direct SQL - following the inheritance relationship
Quote
2. When you have multiple inheritance, which base stereotype takes precedence?

Cheers :-)
None takes precedence... We haven't found this to be a problem.  Do you have a use case where you need one to take precedence?

Paolo

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