Book a Demo

Author Topic: Can we inherit shapescript fragments?  (Read 3832 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Can we inherit shapescript fragments?
« on: February 15, 2021, 11:48:04 am »
In other posts, I've dealt with our progress toward using a fully-modelled MDG (from a previously hand-crafted one).

We've now got shapescript inheritance working (after a fashion).  We can inherit decorations relatively successfully.  This significantly reduces the maintenance burden as our MDG evolves.

Our next adventure is how to handle multiple naming of items on diagrams (preferably using inheritance).  So we have a common (but not identical) mechanism for displaying one of several possible (held in tags) names for an item by defining "shape label()".  The name selector part is identical, but the location of the label can vary by the metatype.  Sometimes it's central, other times SW, etc.  (you get the idea). 

Obviously, once the item is on the diagram, the label can be moved wherever the user wants it; but this is additional friction if the label isn't where one would normally place it.

We can't find any way to get the common name selector code inherited (other than by embedding in a small set of standard supplemental shapescript stereotypes that vary only by the location of the label) so that we reduce the maintenance burden analogously to the decorations.  Is our analysis correct?  (and I don't include calling MDG code)  If not, what's the "secret sauce".

TIA,
Paolo

[Edit:  It seems that "shape label()" can't be inherited.  :(  This is somewhat in line with Eve's comment in the other inheritance thread - "In UML terms, the main script is redefinable. All decorations are added to the collection."  But in order to be redefinable, shouldn't it be inheritable?  Can anyone confirm or deny?]
« Last Edit: February 16, 2021, 01:22:57 pm 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: Can we inherit shapescript fragments?
« Reply #1 on: February 18, 2021, 03:26:08 pm »
[BUMP]

It seems that "shape label()" can't be inherited.  :(  This is somewhat in line with Eve's comment in the other inheritance thread - "In UML terms, the main script is redefinable. All decorations are added to the collection."  But in order to be redefinable, shouldn't it be inheritable?  Can anyone confirm or deny?]

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

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Can we inherit shapescript fragments?
« Reply #2 on: February 19, 2021, 10:22:41 am »
In UML terms, the main script is redefinable.
Shape label is neither a decoration or the main script, I didn't comment on the behavior for it at all. If you think it's not working send in a report.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can we inherit shapescript fragments?
« Reply #3 on: February 19, 2021, 11:08:26 am »
In UML terms, the main script is redefinable.
Shape label is neither a decoration nor the main script, I didn't comment on the behaviour for it at all. If you think it's not working send in a report.
(my emphasis)
Thanks, I understood that but was extrapolating.  But can you confirm that if I omit a shape main from a descendant it will (should) inherit the shape main from the antecedent?

Assuming the answer above is yes, I think shapes should be inheritable/redefinable and decorations additive.

Paolo


[Edit: Defect reported.]
« Last Edit: February 19, 2021, 11:16:38 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!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Can we inherit shapescript fragments?
« Reply #4 on: February 19, 2021, 11:32:20 am »
My test did include an example where I omitted the main entirely and one where the only call in main was to call the parent shape. They were equivalent.