Author Topic: Weird <Apply type> behaviour  (Read 2468 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Weird <Apply type> behaviour
« on: July 27, 2020, 09:12:53 pm »
We have a metatype "Grouping" (which behaves a bit like an Archimate Grouping).  The handcrafted definition has the Apply type="Component".  It also inherits from a higher level abstract metatype whose Apply type="Class".

Should that be an issue?

In any event with that definition, it would not drag from the toolbox any more.  It would "silently fail".

In trying to diagnose the problem, I dragged on another item and tried to reset the stereotype.  I was able to do this, but noticed that the Stereotype assignment dialog said the Apply type for Grouping was "Class" only.  Not "Component" nor even "Component, Class".   Note: the item was a class based metatype - so I suspect that's why.

Anyway, changing the Apply type to Apply type="Class" allowed the item to be dragged from the Toolbox.

Can anyone explain why and what was wrong with the original definition?

As an aside, could I create an abstract metatype WITHOUT an Apply type= section?  So I could pass on the other aspects of the abstract metatype, but not impede the specialized metatype?

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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Weird <Apply type> behaviour
« Reply #1 on: July 27, 2020, 09:17:16 pm »
I can't contribute. I almost never use the Apply since it does not override but add the stereotype (and you don't have a choice which would be easy to implement with another choice in the drop down). Adding a stereotype in my case is not what is wanted.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Weird <Apply type> behaviour
« Reply #2 on: July 28, 2020, 10:38:08 am »
What form is your toolbox specifying the item?

It should work if you fully specify it. ie. MyProfile::Grouping(UML::Component). If you only specify the stereotype but not the applies it doesn't know which extension to use.

When you extend Class on the specialized type instead, it still only extends class and the settings within that extension override the base one.

I would always create an abstract stereotype without an extension when I plan to specialize it from stereotypes that extend different metatypes.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Weird <Apply type> behaviour
« Reply #3 on: July 28, 2020, 10:57:28 am »
What form is your toolbox specifying the item?

It should work if you fully specify it. ie. MyProfile::Grouping(UML::Component). If you only specify the stereotype but not the applies it doesn't know which extension to use.

When you extend Class on the specialized type instead, it still only extends class and the settings within that extension override the base one.

I would always create an abstract stereotype without an extension when I plan to specialize it from stereotypes that extend different metatypes.
(my emphasis)
Thanks, Eve,

Yes, that's the conclusion I came to (about the abstract metatypes).  I'll check the specifics of the specification (pun unavoidable  ;)).

Paolo
« Last Edit: July 28, 2020, 10:59:06 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!