Book a Demo

Author Topic: inheritance hierarchy in UML profile  (Read 3202 times)

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
inheritance hierarchy in UML profile
« on: August 11, 2020, 07:18:46 pm »
I'm creating some new stereotypes in a UML profile and have an inheritance hierarchy. Ultimately, I only want to use the leaf as the class. All the other super stereotypes have been marked as abstract until I get to the Extends relation to a meta-class such as Port or Class.

When I use my profile however, I noticed that when I use the context menu to "add new", the whole dialog box is greyed out and it states I can add classes of type A, B, C when in reality, all I want is C. It's as if it adds all three stereotypes at once.

should the metaclass go at the top of the hierarchy, or only be connected to the leaf stereotype?

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: inheritance hierarchy in UML profile
« Reply #1 on: August 11, 2020, 09:33:12 pm »
Hello,

There are some ifs and buts to this, but in general, «metaclass»es should be extended by the leaf (non-abstract) «stereotype» classes, not by the abstract ones.
This is the right way to do it if the abstract «stereotype» classes are there to specify tagged values and some special attributes, such as _metatype and _instanceType.
Note, however, that the _image and icon special attributes are not inherited this way, but must be repeated in every leaf «stereotype» that needs them.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: inheritance hierarchy in UML profile
« Reply #2 on: August 11, 2020, 11:22:52 pm »
I'm creating some new stereotypes in a UML profile and have an inheritance hierarchy. Ultimately, I only want to use the leaf as the class. All the other super stereotypes have been marked as abstract until I get to the Extends relation to a meta-class such as Port or Class.

When I use my profile however, I noticed that when I use the context menu to "add new", the whole dialog box is greyed out and it states I can add classes of type A, B, C when in reality, all I want is C. It's as if it adds all three stereotypes at once.

should the metaclass go at the top of the hierarchy, or only be connected to the leaf stereotype?
Why is that a problem?

Let's say that you have created a taxonomy, extending the Class metatype, like: Kingdom, Phylum, Class, Order, Genus, Species. If you want to create a new species - e.g., Homo sapiens -  you need to create or reuse each one of their classifiers: Animalia (Kingdom), Cordata (Phylum), Mammalia (Class), Primates (Order), and Homo (Genus).

I don't really understand the problem you are describing. At the very minimun, if you extend a <<metaclass>>, such as Class, when you use it you have to specify a name, even if it is abstract. In other words, I am not sure you can extend the Class <<metaclass>> to create a Being (abstract) and a Sentient Being and, then create a Human <<Sentient Being>> with a classifier of <<Being>>.

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: inheritance hierarchy in UML profile
« Reply #3 on: August 11, 2020, 11:34:25 pm »
I got some more insight into my problem and what is going on after reading some EA literature. Here is the main problem now. I will use the example of taxonomy as a continuation.

I have the stereotypes as you described, now I get to Chordata in my tagged values when I am using the profile. I would like to select either Mammalia or Aves. How can I enable such a thing?

In the EA literature, I realized I don'T have to create a stereotype for everything, I can use plain classes to create record-like tags. This works perfectly until I get to a point where I Have to differentiate and choose based on something above in the hierarchy.

For now, in the tagged values, I can see the following:

Animalia,
Chordata
...

However, getting Mammalia or Aves is not possible. I have them both generalizing Chordata, but nothing shows up in the tagged values.