Author Topic: v15.2 – What is FQN of «stereotype» (from Profiles)?  (Read 11105 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 7921
  • Karma: +205/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
v15.2 – What is FQN of «stereotype» (from Profiles)?
« on: May 27, 2021, 02:44:19 pm »
As we build our Metamodel based MDG, we are extending that specific repository to hold the instances of the «stereotype»s we generate (so we can easily see if our inheritance hierarchy is working (for rendering purposes) and also to link into the metamodel diagrams (again, using instances of the «stereotype»s).

We use an "instance of" relationship to link the instance to the «stereotype».  We used to have to go to the toolbox to explicitly select the "instance of" relationship and then apply it to the items on the diagram.  :(  We got sick of this; so experimented with using external «stereotype» (stereotype) as part of our MDG specification and allowing the QuickLinker to create the relationship for us.  It was incredibly easy...  We just added "; stereotype" to our pre-existing root item specification for the "instance of" relationship and voilà we get our QuickLinker entry!  Any of our MDG «stereotype»s can be linked to the appropriate «stereotype» via the QuickLinker!  8) 

However, careful checking of the Quicklinker mechanism showed that the reverse relationship (from «stereotype» to our MDG Item instance) was not available!  :o

Is this because (as we've discovered with some specialised «stereotype»s) EA plays "silly b*ggers" with them?  For example, in order to get EAUML::table etc. to work with our MDG we have to misname them in the MDG model and fix up the generated MDG post-facto.

When we drag a «metaclass» from the Profile toolbox onto the diagram we generate a UML Standard Profile::Metaclass stereotyped item (note change of case).  However, when we drop a «stereotype» onto the diagram, we seem to generate a simple "stereotype" that doesn't have an FQN (it has a GUID - making it a local stereotype).  We would have thought it should?  Does it actually have one and can we use it to inform our MDG usage?

Can anybody shed any light?

Paolo
« Last Edit: May 27, 2021, 03:25:24 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!

qwerty

  • EA Guru
  • *****
  • Posts: 12263
  • Karma: +346/-285
  • I'm no guru at all
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #1 on: May 27, 2021, 05:37:44 pm »
I'd be interested in that too, though just standing in front of the door and not started battling with the QL (so basically we are also just using the «stereotype» for the toolbox).

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7536
  • Karma: +94/-17
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #2 on: May 28, 2021, 09:40:05 am »
You can use it as the target of a metaconstraint by using a «metaclass» named Stereotype.  Which is how it's defined in UML, despite the implementation, which is still basically the same as the less formally defined stereotype notation described prior to UML 2.
Eve

support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 7921
  • Karma: +205/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #3 on: May 28, 2021, 10:45:42 am »
You can use it as the target of a metaconstraint by using a «metaclass» named Stereotype.  Which is how it's defined in UML, despite the implementation, which is still basically the same as the less formally defined stereotype notation described prior to UML 2.
Bit thick this morning, Eve (Covid jab yesterday)
Are you saying stereotype «extends» Stereotype or that the «metaclass»is unrelated to the «stereotype»?

Also, is the FQN of «stereotype» just a local GUID or is it part of a profile?

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: 7536
  • Karma: +94/-17
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #4 on: May 28, 2021, 11:12:08 am »
It doesn't look like it's part of a profile at all.

I dropped the 'Class' metaclass, renamed it to 'Stereotype' and deleted the isActive property that I didn't care about.

I then created two metaconstraint relationships from my stereotyped relationship to that element. Labelled one as source, the other as target.

After importing the profile that relationship was available between two stereotypes.
Eve

support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 7921
  • Karma: +205/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #5 on: May 28, 2021, 01:15:26 pm »
It doesn't look like it's part of a profile at all.

I dropped the 'Class' metaclass, renamed it to 'Stereotype' and deleted the isActive property that I didn't care about.

I then created two metaconstraint relationships from my stereotyped relationship to that element. Labelled one as the source, the other as a target.

After importing the profile that relationship was available between two stereotypes.
Shouldn't it be (part of a profile)?

I tried to do what you said...  But it's not working for us.
Here's the model


I'm using the VwOf (View Of) relationship as a marker that I'm able to create a QL between «stereotype»s.  FYI Root¯R is our Root element (for our concrete metatypes - in the REAL repository).  The model successfully allows the creation of an Extension relationship between our own metatypes and a «metaclass»
It generates...
Code: [Select]
<Stereotype name="Root¯R" metatype="Root (Concept)" notes="" cx="0" cy="0" bgcolor="13434828" fontcolor="-1" bordercolor="6160384" borderwidth="2" hideicon="0" isAbstract="true">
<metarelationships>
<metarelationship metaclass="Extension" constraint="StandardProfileL2::Metaclass"/>
</metarelationships>
Which seems to work fine...
The stereotype «stereotype» generates...
Code: [Select]
<Stereotype name="stereotype" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="3" hideicon="0">
<metarelationships>
<metarelationship metaclass="Extension" constraint="StandardProfileL2::Metaclass"/>
</metarelationships>
<stereotypedrelationships>
<stereotypedrelationship stereotype="PrIME::VwOf" constraint="stereotype"/>
</stereotypedrelationships>
</Stereotype>
NOTE: in practice, it generates PrIME::stereotype (not unreasonably), but that is, naturally, incorrect so we remove the PrIME:: references.
This doesn't allow the creation of the Extension relationship nor of the VwOf.

Elsewhere (in Root¯R), we have the following specification...
Code: [Select]
<stereotypedrelationship stereotype="PrIME::InstncOf" constraint="source.metatype.both;stereotype"/>
This does create the ability to create an instance of relationship from one of our metatypes to a «stereotype».  It also allows the creation of the same relationship to a metaclass (which seems a defect - can you confirm?)

From the above are you able to advise what we've done wrong?  Perhaps you could post your output so we can compare and contrast?

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: 7536
  • Karma: +94/-17
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #6 on: May 28, 2021, 02:03:29 pm »
Code: [Select]
<?xml version="1.0" encoding="windows-1252"?>
<UMLProfile profiletype="uml2">
<Documentation id="19520E10-8" name="PrIME" version="1.0" notes="PrIME"/>
<Content>
<Stereotypes>
<Stereotype name="InstncOf" notes="">
<AppliesTo>
<Apply type="Dependency"/>
</AppliesTo>
</Stereotype>
<Stereotype name="VwOf2" notes="">
<AppliesTo>
<Apply type="Dependency"/>
</AppliesTo>
</Stereotype>
<Stereotype name="Thing" notes="" generalizes="Root¯R" baseStereotypes="Root¯R">
<AppliesTo>
<Apply type="Class"/>
</AppliesTo>
</Stereotype>
Nothing remarkable here, just some concrete definitions to test with.
Code: [Select]
<Stereotype name="Root¯R" notes="" isAbstract="true">
<stereotypedrelationships>
<stereotypedrelationship stereotype="PrIME::InstncOf" constraint="Stereotype"/>
</stereotypedrelationships>
</Stereotype>
The root stereotype defines a stereotyped relationship matching the stereotype above. Because it's targeting a metaclass it doesn't get a qualified name.

Code: [Select]

<Stereotype name="VwOf1" notes="">
<metaconstraints>
<metaconstraint umlRole="source" constraint="Stereotype"/>
<metaconstraint umlRole="target" constraint="Stereotype"/>
</metaconstraints>
<AppliesTo>
<Apply type="Dependency"/>
</AppliesTo>
</Stereotype>
First way to define something between two metaclasses (in this case Stereotype). I've added a source and target constraint to the stereotype.
Code: [Select]
</Stereotypes>
<TaggedValueTypes/>
<ViewDefinitions/>
<Metamodel>
<Metaclass name="Stereotype" notes="">
<stereotypedrelationships>
<stereotypedrelationship stereotype="PrIME::VwOf2" constraint="Stereotype"/>
</stereotypedrelationships>
</Metaclass>
</Metamodel>
</Content>
</UMLProfile>
The second way to add something between two metaclasses (in this case the Stereotype metaclass). A stereotyped relationship self connector has been added on the metaclass element and this is the result.

In terms of your diagram:
  • «stereotyped relationship» { stereotype = PrIME::InstcOf } needs to point to «metaclass» Stereotype
  • «metaconstraint» { umlRole = source } and «metaconstraint» { umlRole = target } needs to go from «stereotype» VwOf OR
  • «stereotyped relationship» { stereotype = PrIME::VwOf } needs to point to/from «metaclass» Stereotype
  • That should allow you to remove «stereotype» stereotype
« Last Edit: May 28, 2021, 02:11:20 pm by Eve »
Eve

support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 7921
  • Karma: +205/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #7 on: May 28, 2021, 04:02:15 pm »
Thanks, Eve, that's helped a lot!  However, there's one bit missing...
Here's the model...

So I'm trying to create an Extension relationship between a «stereotype» and a «metaclass» (since I can't wait for Sparx to fix the missing QL entry ;)).  Originally, based on your last input, I created the Extension metaclass and used the metaconstraints from there.  That didn't work.  So, given that our own VwOf relationship worked, I synthesised the Extnsn relationship. Which yields...
Code: [Select]
<Stereotype name="Extnsn" metatype="Extension" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
<metaconstraints>
<metaconstraint umlRole="source" constraint="Stereotype"/>
<metaconstraint umlRole="target" constraint="StandardProfileL2::Metaclass"/>
</metaconstraints>
<AppliesTo>
<Apply type="Extension">
<Property name="direction" value="Source -&gt; Destination"/>
<Property name="isRequired" value=""/>
<Property name="_MeaningBackwards" value="extended by¤"/>
<Property name="_MeaningForwards" value="extends"/>
<Property name="_HideUmlLinks" value="true"/>
</Apply>
</AppliesTo>
</Stereotype>
Which looks OK to me, but also doesn't work!

Any ideas where I've gone wrong with the latest version?

BTW: the metarelationship between our metatypes and any «metaclass» (for testing purposes) works fine!

Paolo
« Last Edit: May 28, 2021, 04:03:49 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!

qwerty

  • EA Guru
  • *****
  • Posts: 12263
  • Karma: +346/-285
  • I'm no guru at all
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #8 on: May 28, 2021, 09:09:36 pm »
It doesn't look like it's part of a profile at all.

I dropped the 'Class' metaclass, renamed it to 'Stereotype' and deleted the isActive property that I didn't care about.

I then created two metaconstraint relationships from my stereotyped relationship to that element. Labelled one as source, the other as target.

After importing the profile that relationship was available between two stereotypes.
Coincidence. I stumbled over the same issue. When using the stereotype assignment via the ellipsis there is no «stereotype» available from any of the offered profiles. Makes me really wonder. This should be a very basic stereotype defined in the guts of UML, shouldn't it?

q.
« Last Edit: May 29, 2021, 05:31:52 pm by qwerty »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7536
  • Karma: +94/-17
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #9 on: May 31, 2021, 08:29:41 am »
Shouldn't it be (part of a profile)?
This should be a very basic stereotype defined in the guts of UML, shouldn't it?
No, it isn't defined as a stereotype in UML. It's a metaclass.

Over time we have many metaclass + stereotype combinations with the unique metaclass specified by UML (which usually have a keyword associated with them so it looks the same). Doing that inevitably causes pain not just to developers but also end users, so it's not a straightforward decision.
Eve

support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 7921
  • Karma: +205/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #10 on: May 31, 2021, 10:15:16 am »
Shouldn't it be (part of a profile)?
This should be a very basic stereotype defined in the guts of UML, shouldn't it?
No, it isn't defined as a stereotype in UML. It's a metaclass.

Over time we have many metaclass + stereotype combinations with the unique metaclass specified by UML (which usually have a keyword associated with them so it looks the same). Doing that inevitably causes pain not just to developers but also end-users, so it's not a straightforward decision.
Thanks for the clarification, Eve.  What is the impact, then, on my trying to get the Extension relationship between a «stereotype» and a «metaclass»?

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: 7536
  • Karma: +94/-17
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #11 on: May 31, 2021, 10:44:55 am »
What is the impact, then, on my trying to get the Extension relationship between a «stereotype» and a «metaclass»?
The problem is that the best you can do is exactly what EA already defines. I'm not sure if there is a viable way to create the definition if the one that is already there is failing.

Create a «metarelationship» { metaclass = Extension } from «metaclass» Stereotype to StandardProfileL2::Metaclass.

That should result in this being generated to your profile.
Code: [Select]
<Metamodel>
<Metaclass name="Stereotype" notes="">
<metarelationships>
<metarelationship constraint="StandardProfileL2::Metaclass" metaclass="Extension"/>
</metarelationships>
</Metaclass>
</Metamodel>
Eve

support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 7921
  • Karma: +205/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #12 on: May 31, 2021, 11:14:55 am »
What is the impact, then, on my trying to get the Extension relationship between a «stereotype» and a «metaclass»?
The problem is that the best you can do is exactly what EA already defines. I'm not sure if there is a viable way to create the definition if the one that is already there is failing.

Create a «metarelationship» { metaclass = Extension } from «metaclass» Stereotype to StandardProfileL2::Metaclass.

That should result in this being generated to your profile.
Code: [Select]
<Metamodel>
<Metaclass name="Stereotype" notes="">
<metarelationships>
<metarelationship constraint="StandardProfileL2::Metaclass" metaclass="Extension"/>
</metarelationships>
</Metaclass>
</Metamodel>
Thanks, Are you saying that there already IS a definition but the QuickLinker isn't displaying it?  I was wondering because I got the impression the lack of it was going to be fixed in the last update.

I have realised just before I read your post that we weren't getting the Metamodel componentry in our final MDG (because f the way we generate it).  However, we rectified that earlier this morning.  Unfortunately, to no avail.  Our generation is the same as yours above.  It just doesn't seem to work.  Could the placement of the Metamodel section be an issue?  Do we just include it in the MDG Generation MTS file as a profile?

Paolo

[Edit:  Forgot to ask... Does that construct work for you?]
« Last Edit: May 31, 2021, 12:15:22 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!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7536
  • Karma: +94/-17
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #13 on: May 31, 2021, 12:34:12 pm »
Thanks, Are you saying that there already IS a definition but the QuickLinker isn't displaying it?
There is a definition, but on further investigation it's not identical to the definition I gave you. I can see that it's not going to match a UML Standard Profile::Metaclass in the quicklinker. It appears to be matching a model based «metaclass» definition only.

[Edit:  Forgot to ask... Does that construct work for you?]
To my surprise1, it does. It results in an added valid target for an extension from a Stereotype, which is the metaclass stereotype from the appropriate profile.

1 Because I thought above that it generated exactly what was already defined, which was incorrect.
Eve

support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 7921
  • Karma: +205/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15.2 – What is FQN of «stereotype» (from Profiles)?
« Reply #14 on: May 31, 2021, 01:38:14 pm »
It's not working for me...

In this model, I can get the "PrIME::Extnsn" relationship to generate a stereotyped (Extnsn) Extension between a «stereotype» and a «metaclass» (but NOT the reverse!).  I can't get an unstereotyped Extension from a Stereotype (as shown between Stereotype and StandardProfileL2::Metaclass)  [The "£" is removed during generation - if I remove it in the model, then
Code: [Select]
<Stereotype name="StandardProfileL2::Metaclass£" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
<AppliesTo>
<Apply type="Metaclass">
<Property name="_HideUmlLinks" value="true"/>
</Apply>
</AppliesTo>
</Stereotype>
is removed from the MDG - but it seems to make no difference anyway]

The (I believe) relevant parts of the generation are:
Code: [Select]
<Stereotype name="Extnsn" metatype="Extension" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
<metaconstraints>
<metaconstraint umlRole="source" constraint="Stereotype"/>
<metaconstraint umlRole="target" constraint="StandardProfileL2::Metaclass"/>
</metaconstraints>
<AppliesTo>
<Apply type="Extension">
<Property name="direction" value="Source -&gt; Destination"/>
<Property name="isRequired" value=""/>
<Property name="_MeaningBackwards" value="extended by¤"/>
<Property name="_MeaningForwards" value="extends"/>
<Property name="_HideUmlLinks" value="true"/>
</Apply>
</AppliesTo>
</Stereotype>
and
Code: [Select]
<Metamodel>
<Metaclass name="Stereotype" notes="">
<metarelationships>
<metarelationship metaclass="Extension" constraint="StandardProfileL2::Metaclass"/>
</metarelationships>
</Metaclass>
</Metamodel>

Any ideas?

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