Book a Demo

Author Topic: Metarelationship to a specific metatype, exluding the subtypes  (Read 3910 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
I'm working on an MDG model and I'm trying to implement a bunch of rules for relationship between the different stereotypes.

In this case I wanted to say that my stereotype can be related to a plain UML Class using a dependency.
This works, but the problem is that it also allows a dependency to all possible subtypes of Class, including Components, and stereotyped Components.
This sort of defeats the point of having constraints, as most of the stereotypes I'm dealing with in this profile are derived from Class or Component.

Is there any way to say I want to allow a Dependency to UML class only, not to one of its derived entities?

Very similar to this. If I put Dependency in the metaclass tag of my metarelationship, I'm automatically getting Abstraction and Realization as well, as these are subtypes of Dependency. Is there any way to allow only Dependency, and not Abstraction and Realization?

Thanks

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Metarelationship to a specific metatype, exluding the subtypes
« Reply #1 on: June 29, 2020, 12:12:43 pm »
Is there any way to say I want to allow a Dependency to UML class only, not to one of its derived entities?

Unfortunately, the only context where this has been implemented is for linking to the same point in the inheritance hierarchy for stereotypes.

You can use Filter to Toolbox so that the option isn't suggested by default, but not actually restrict it. At one point I did want to see an added tag on those relationships to specify handling of the specializations. I think it just wasn't needed for the profiles we used it for internally.

Is there any way to allow only Dependency, and not Abstraction and Realization?
Yes, you can override the rule for Abstraction and Realization, which will prevent it from being available. If your target is a metaclass with the name "<none>" that will prevent them from being available in recent versions. Older versions you would still have <none> show up in the quicklinker but it obviously won't work. (The behavior wasn't defined prior to 15.1 I believe)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Metarelationship to a specific metatype, exluding the subtypes
« Reply #2 on: June 29, 2020, 03:31:59 pm »
Thanks Eve,

This client is still on v14, but once they get to 15.1 I'll try the <none> trick.

Should I send in a feature request to allow relations to a certain meta/stereo-type and not the specialized types?

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Metarelationship to a specific metatype, exluding the subtypes
« Reply #3 on: June 29, 2020, 03:59:17 pm »
<none> may even be preferable to the relationship being available in old versions. Another option may be to use an abstract stereotype with no specializations as the target. 14 may be smart enough to hide the relationship in the quicklinker in that case.

I can see likely implementation issues with excluding specialized targets, but that's not a reason to not make the request.