Book a Demo

Author Topic: Model-based MDG Stereotype inheritance - What's going on?  (Read 3078 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Model-based MDG Stereotype inheritance - What's going on?
« on: March 04, 2020, 11:14:16 am »
In testing model-based MDG generation, we wanted to simulate the inclusion of supplemental stereotypes.  We've been advised that we can use stereotype specialisation to achieve this and our testing confirms this works.

We previously hand-crafted this test and it was a simple generalizes="Suppl" baseStereotypes="Suppl" addition to the concrete stereotype definition ("Item").

For our model-based test, we we created the self-referencing stereotyped relationships to a high-level abstract stereotype ("Elmnt") and tested that out by having our concrete stereotype definition generalizes="Elmnt" baseStereotypes="Elmnt".  So far, so good!  All the QuickLinker relationships worked as we intended!

We added the generalization of the concrete "Item" to include the supplementary.  When we generated the MDG, we found
Code: [Select]
<Stereotype name="Item" metatype="Item" ... generalizes="Elmnt" baseStereotypes="Elmnt Suppl">We found that the generalizes clause only contained one generalization stereotype.

Can anyone explain why?  (not a criticism, just a question)
If it only provides one (in this case of the two possible) why did it pick "Elmnt" over "Suppl"?

What's the theoretical basis for this outcome?

We need to understand for planning the transition purposes.

Paolo

« Last Edit: March 04, 2020, 11:23:21 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!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Model-based MDG Stereotype inheritance - What's going on?
« Reply #1 on: March 04, 2020, 11:31:16 am »
It's a legacy from before multiple-inheritance was implemented. It is only used if baseStereotypes is empty or missing.
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Model-based MDG Stereotype inheritance - What's going on?
« Reply #2 on: March 04, 2020, 11:42:51 am »
It's a legacy from before multiple-inheritance was implemented. It is only used if baseStereotypes is empty or missing.
Thanks Neil,

So, if I understand correctly, so long as baseStereotypes is correct, then we can ignore the generalizes clause, yes?

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

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Model-based MDG Stereotype inheritance - What's going on?
« Reply #3 on: March 04, 2020, 11:52:41 am »
That's what the source code says. But I would recommend putting the generalizes attribute in regardless, just in case. Give it the first item from the baseStereotypes list.
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Model-based MDG Stereotype inheritance - What's going on?
« Reply #4 on: March 04, 2020, 03:00:32 pm »
That's what the source code says. But I would recommend putting the generalizes attribute in regardless, just in case. Give it the first item from the baseStereotypes list.
This was generated by the model, not manually.  So will the model ALWAYS set the generalizes value to the first item in the baseStereotypes?

My point was that so long as the baseStereotypes had the correct list, we can effectively ignore what the generalizes attribute contains, from a validation point of view (so long as the value is in the baseStereotypes list).  If we create this manually, we still have to abide by that rule.

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