Book a Demo

Author Topic: Use of Alias in Metaclasses - Safe?  (Read 6304 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8617
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Use of Alias in Metaclasses - Safe?
« on: December 20, 2018, 11:50:22 am »
As we convert our handcrafted MDG to metamodel based, we find that we have a series of metaclasses same name but different properties (for example - Associations => Aggregation, Association => Composition, Association => Association).  We need to be able to distinguish between them so that we don't extend the wrong instance.

We hit upon the idea of using the Alias property of the Metaclass to hold the explicit name and setting the diagrams to [X] Use Alias if available.

A scan of the documentation suggests this is safe, but I thought I'd check here also.
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1346
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Use of Alias in Metaclasses - Safe?
« Reply #1 on: December 21, 2018, 11:55:50 am »
Quote
...handcrafted MDG to metamodel based...
Is this moving from hacking the xml to putting it into a model and generating it then?
How far are you along with that?
Is it the ArchiMate MDG you've mentioned in previous posts?

Quote
...we find that we have a series of metaclasses same name but different properties (for example - Associations => Aggregation, Association => Composition, Association => Association).  We need to be able to distinguish between them so that we don't extend the wrong instance...
Uh? I can't even comprehend why?
Code: [Select]
...We hit upon the idea of using the Alias property of the Metaclass to hold the explicit name and setting the diagrams to [X] Use Alias if available...I guess you could, can't see any reason why not.
Happy to help
:)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8617
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Use of Alias in Metaclasses - Safe?
« Reply #2 on: December 21, 2018, 12:19:10 pm »
Quote
...handcrafted MDG to metamodel based...
Is this moving from hacking the xml to putting it into a model and generating it then?
How far are you along with that?
Is it the ArchiMate MDG you've mentioned in previous posts?
We have an intern working one day per week.  Progress has been quite good, but issues with understanding the requirements of EA in generating MDGs have delayed things.  We are confident we can convert to a model without losing any substantive flexibility we had in the handcrafted MDG.

Our MDG is similar to ArchiMate, but at this stage, because of our specialised needs we're not thinking of extending the ArchiMate MDG, but merely tracking it (running alongside - so to speak).
Quote
Quote
...we find that we have a series of metaclasses same name but different properties (for example - Associations => Aggregation, Association => Composition, Association => Association).  We need to be able to distinguish between them so that we don't extend the wrong instance...
Uh? I can't even comprehend why?
All stereotypes are created equal, but some are more equal than others. For example, this Association metaclass is used for bidirectional stereotypes, this other Association metaclass is used for Aggregations.  Each one has different settings for the properties, but they are both named Association.  By using the Alias, we can be clear about which one we're linking to (for new stereotypes)
Quote
Code: [Select]
...We hit upon the idea of using the Alias property of the Metaclass to hold the explicit name and setting the diagrams to [X] Use Alias if available...I guess you could, can't see any reason why not.
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Use of Alias in Metaclasses - Safe?
« Reply #3 on: December 21, 2018, 03:27:30 pm »
All stereotypes are created equal, but some are more equal than others. For example, this Association metaclass is used for bidirectional stereotypes, this other Association metaclass is used for Aggregations.  Each one has different settings for the properties, but they are both named Association.  By using the Alias, we can be clear about which one we're linking to (for new stereotypes)
Paolo,

Be aware that you are supposed to create a new metaclass for each of your stereotypes.
Re-using metaclasses is a bad idea as some of the properties of the stereotype are stored on the metaclass.

Use the profile helper as much as possible.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8617
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Use of Alias in Metaclasses - Safe?
« Reply #4 on: December 22, 2018, 11:35:15 am »
All stereotypes are created equal, but some are more equal than others. For example, this Association metaclass is used for bidirectional stereotypes, this other Association metaclass is used for Aggregations.  Each one has different settings for the properties, but they are both named Association.  By using the Alias, we can be clear about which one we're linking to (for new stereotypes)
Paolo,

Be aware that you are supposed to create a new metaclass for each of your stereotypes.
Re-using metaclasses is a bad idea as some of the properties of the stereotype are stored on the metaclass.

Use the profile helper as much as possible.

Geert
I thought you created a metaclass for each unique combination.  Certainly, if two metaclasses have the same properties, then conceptually they are the same.  I'm pretty sure it used to work that way in the past.  When did it change?

Without loss of generality, surely I can combine them.

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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Use of Alias in Metaclasses - Safe?
« Reply #5 on: December 22, 2018, 04:42:25 pm »
Yes, of course, if the metaclasses have exactly the same properties then you can re-use them, but to avoid any confusion I would avoid that.
Things like "meaning forwards" and "meaning backwards" are stored on the metaclass, and those are generally not properties you would want to share amongst different stereotypes.

Geert
« Last Edit: December 22, 2018, 04:44:13 pm by Geert Bellekens »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8617
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Use of Alias in Metaclasses - Safe?
« Reply #6 on: December 22, 2018, 07:31:51 pm »
Yes, of course, if the metaclasses have exactly the same properties then you can re-use them, but to avoid any confusion I would avoid that.
Things like "meaning forwards" and "meaning backwards" are stored on the metaclass, and those are generally not properties you would want to share amongst different stereotypes.

Geert
Ah... Good point!  We haven't used that till now, but we will in future.  Pity they didn't put that in the stereotype!  I mean if you now have to have a 1:1 then it's not really a metaclass, it's a stereotype by another name.

Have you confirmed it's ONLY in the metaclass?  I might try some experiments.

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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Use of Alias in Metaclasses - Safe?
« Reply #7 on: December 22, 2018, 11:54:41 pm »
Yes, of course, if the metaclasses have exactly the same properties then you can re-use them, but to avoid any confusion I would avoid that.
Things like "meaning forwards" and "meaning backwards" are stored on the metaclass, and those are generally not properties you would want to share amongst different stereotypes.

Geert
Ah... Good point!  We haven't used that till now, but we will in future.  Pity they didn't put that in the stereotype!  I mean if you now have to have a 1:1 then it's not really a metaclass, it's a stereotype by another name.
Yes, I consider stereotype + metaclass as two parts of the same definition.
Quote
Have you confirmed it's ONLY in the metaclass?  I might try some experiments.
No I haven't played messed with it yet. I simply used the profile helper and the property ended up in the metaclass.
Even it it works when you put it on the stereotype, you don't have any guarantees.
Sparx may change that behavior, they might even consider it a bug it it works on stereotypes and "fix" it in a next release.

I've been doing some work with the new quicklink definitions based on the metamodel constraints, and it is a big step forward from the CSV format.
You still have to make sure that everything is exactly as EA expects it or it won't work (without error/warning message), but that seems to be the standard when it comes to UML profiles and MDG's.

Geert

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1346
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Use of Alias in Metaclasses - Safe?
« Reply #8 on: December 23, 2018, 03:42:10 pm »
If you like I can provide you a model that creates an ArchiMate MDG. Might save you a lot of time and effort. Of course its probably not got your exact requirements but you can modify it.
Happy to help
:)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8617
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Use of Alias in Metaclasses - Safe?
« Reply #9 on: January 07, 2019, 01:16:32 pm »
Yes, of course, if the metaclasses have exactly the same properties then you can re-use them, but to avoid any confusion I would avoid that.
Things like "meaning forwards" and "meaning backwards" are stored on the metaclass, and those are generally not properties you would want to share amongst different stereotypes.

Geert
Ah... Good point!  We haven't used that till now, but we will in future.  Pity they didn't put that in the stereotype!  I mean if you now have to have a 1:1 then it's not really a metaclass, it's a stereotype by another name.
Yes, I consider stereotype + metaclass as two parts of the same definition.
[SNIP]
Can a Sparxian make a comment (or must I submit a formal request to clarify)?

Paolo
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: 8617
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: _MeaningForwards in Metaclass
« Reply #10 on: January 16, 2019, 04:19:02 pm »
So, we tried to create _MeaningForwards and _MeaningBackwards in the metaclass, but it didn't generate into the MDG.  Can some kind soul provide an example so we can check what we're doing wrong?

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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: _MeaningForwards in Metaclass
« Reply #11 on: January 16, 2019, 04:25:24 pm »
So, we tried to create _MeaningForwards and _MeaningBackwards in the metaclass, but it didn't generate into the MDG.  Can some kind soul provide an example so we can check what we're doing wrong?

TIA,
Paolo
Did you use the profile helper to add these?

Geert

PS. version needs to be at least 14 (possibly higher) for this to work.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8617
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: _MeaningForwards in Metaclass
« Reply #12 on: January 16, 2019, 04:34:45 pm »
So, we tried to create _MeaningForwards and _MeaningBackwards in the metaclass, but it didn't generate into the MDG.  Can some kind soul provide an example so we can check what we're doing wrong?

TIA,
Paolo
Did you use the profile helper to add these?

Geert

PS. version needs to be at least 14 (possibly higher) for this to work.
No, we just added the attributes to the metaclass.  We're not used to working with Profile helpers yet...   ;)

We'll take a look.
Paolo

[EDIT: It turned out "Santa's little helper" (one of our work experience students) was using the wrong profile file...  We had it right the first time!]
« Last Edit: January 16, 2019, 04:46:32 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!