Author Topic: v15 - How to show self-metatype relationships in metamodel?  (Read 19025 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15 - How to show self-metatype relationships in metamodel?
« Reply #30 on: March 06, 2020, 11:05:43 am »
I'm expecting all four self.metatype variants to work in 15.1.
Thanks, are you able to specify them analogously to that I published on Aug 20, 2019?  If they now work that way then a statement to that effect would be useful.

Paolo
[BUMP]

Any chance of a specific statement on the "current state of play" on this?  We're about to get serious on this and we've noticed some anomalies, but it's not clear if it's something we're doing or defects.  We've noticed that if we're not super-careful, the results aren't as expected, but when we investigate it's usually some "t" we've not dotted or some "i" we've not crossed (mostly).

We don't have a lot of time and effort available to chase down defects.

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: 8061
  • Karma: +118/-20
    • View Profile
Re: v15 - How to show self-metatype relationships in metamodel?
« Reply #31 on: March 06, 2020, 01:02:09 pm »
My sample profile behaves as I would expect.

Code: [Select]
<?xml version="1.0" encoding="windows-1252"?>
<UMLProfile profiletype="uml2">
   <Documentation id="65DAE813-A" name="metatypetest" version="1.0" notes="metatypetest"/>
   <Content>
      <Stereotypes>
         <Stereotype name="A" notes="">
            <stereotypedrelationships>
               <stereotypedrelationship stereotype="metatypetest::W" constraint="source.metatype"/>
               <stereotypedrelationship stereotype="metatypetest::X" constraint="source.metatype.general"/>
               <stereotypedrelationship stereotype="metatypetest::Y" constraint="source.metatype.specific"/>
               <stereotypedrelationship stereotype="metatypetest::Z" constraint="source.metatype.both"/>
            </stereotypedrelationships>
            <AppliesTo>
               <Apply type="Class">
                  <Property name="isActive" value=""/>
               </Apply>
            </AppliesTo>
         </Stereotype>
         <Stereotype name="B" notes="" generalizes="A" baseStereotypes="A"/>
         <Stereotype name="C" notes="" generalizes="B" baseStereotypes="B"/>
         <Stereotype name="W" notes="">
            <AppliesTo>
               <Apply type="Dependency">
                  <Property name="_MeaningBackwards" value="RW"/>
                  <Property name="_MeaningForwards" value="FW"/>
               </Apply>
            </AppliesTo>
         </Stereotype>
         <Stereotype name="X" notes="">
            <AppliesTo>
               <Apply type="Dependency">
                  <Property name="_MeaningBackwards" value="RX"/>
                  <Property name="_MeaningForwards" value="FX"/>
               </Apply>
            </AppliesTo>
         </Stereotype>
         <Stereotype name="Y" notes="">
            <AppliesTo>
               <Apply type="Dependency">
                  <Property name="_MeaningBackwards" value="RY"/>
                  <Property name="_MeaningForwards" value="FY"/>
               </Apply>
            </AppliesTo>
         </Stereotype>
         <Stereotype name="Z" notes="">
            <AppliesTo>
               <Apply type="Dependency">
                  <Property name="_MeaningBackwards" value="RZ"/>
                  <Property name="_MeaningForwards" value="FZ"/>
               </Apply>
            </AppliesTo>
         </Stereotype>
      </Stereotypes>
      <TaggedValueTypes/>
      <ViewDefinitions/>
      <Metamodel/>
   </Content>
</UMLProfile>
« Last Edit: March 06, 2020, 01:19:18 pm by Eve »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15 - How to show self-metatype relationships in metamodel?
« Reply #32 on: March 06, 2020, 06:17:33 pm »
My sample profile behaves as I would expect.

[SNIP]

Indeed it does!  Having now played with it, I realise that I have made a fundamental misunderstanding of the functionality provided.  Now that I understand, I see that it is, indeed, providing the specified functionality for:
Metaclass   Description
source.metatype   The target element must match the exact stereotype defined at the source.
source.metatype.general   The target element may match the exact stereotype used at the source and any concrete (isAbstract=false) generalized stereotypes.
source.metatype.specific   The target element may match the exact stereotype used at the source and any concrete (isAbstract=false) specialized stereotypes.
source.metatype.both   The target element may match the exact stereotype used at the source and any concrete (isAbstract=false) generalized or specialized stereotypes.

Unfortunately, for us, that doesn't solve the problem of getting away from a large number of specific QuickLinker entries required.

I can't recall if you (or any other Sparxians mentioned) any other special metatypes. 

If I extend the profile with
Code: [Select]
         <Stereotype name="D" notes="" generalizes="A" baseStereotypes="A"/>
         <Stereotype name="E" notes="" generalizes="D" baseStereotypes="D"/>
I'd like to be able to define the ability to specify relationships between "Ds" and "Bs", "Ds" and "Cs", "Bs" and "Es" and ""Cs" and "Es".  Since they all descend from "A",
I thought something like:
Metaclass   Description
base.metatype   The target element must match the exact stereotype defined at the base. (not particulalry useful)
base.metatype.general   The target element may match the exact stereotype used at the source and any concrete (isAbstract=false) generalized stereotypes thereof.
base.metatype.specific   The target element may match the exact stereotype used at the base and any concrete (isAbstract=false) specialized stereotypes thereof.
base.metatype.both   The target element may match the exact stereotype used at the base and any concrete (isAbstract=false) generalized or specialized stereotypes thereof.

Where the base is the place where the relationship is defined.  In this case, "A".

Does that make sense?  In our last incarnation, the MDG QuickLinker was managed by an Excel workbook and automation what generated nearly 50,000 valid interactions between metatypes -  many of which were merely instances of a more general rule.  If we can't significantly cut down on the list, then we might as well stay with the matrix.

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: 8061
  • Karma: +118/-20
    • View Profile
Re: v15 - How to show self-metatype relationships in metamodel?
« Reply #33 on: March 06, 2020, 08:17:25 pm »
I may be misunderstanding what you're after.

If you want to B and C to be able to link to D and E, just target A itself with the stereotyped relationship. There's no need for a special target because it's consistent across all specialisations.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15 - How to show self-metatype relationships in metamodel?
« Reply #34 on: March 06, 2020, 11:21:20 pm »
I may be misunderstanding what you're after.

If you want to B and C to be able to link to D and E, just target A itself with the stereotyped relationship. There's no need for a special target because it's consistent across all specialisations.
To paraphrase Professor Higgins (My Fair Lady).  "By George, he's got it!"

Works a treat!  Now to have a further play "as time and resources permit"!

Thanks for your help!

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: 8061
  • Karma: +118/-20
    • View Profile
Re: v15 - How to show self-metatype relationships in metamodel?
« Reply #35 on: March 07, 2020, 08:56:27 am »
To paraphrase Professor Higgins (My Fair Lady).  "By George, he's got it!"
I'd prefer the original.

Glad that's what you're after. I really like it it when the easy solution works.
« Last Edit: March 07, 2020, 10:39:21 pm by Eve »