Author Topic: extend abstract metaclass  (Read 5266 times)

Palm

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
extend abstract metaclass
« on: January 16, 2020, 08:59:15 pm »
Hi,

A similar question was posted some years ago, but as I understand it, not answered.

I want to extend the abstract metaclass EnumerationLiteral as a specific stereotype with tagged values. This does not seem to work. It works for core elements but as I understand not for the Abstarct Metatypes. Is this a correct assumption? What should I do to make it work? That is, how to extend the Abstract Metaclass EnumerationLiteral?

Thanks,

Paul

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: extend abstract metaclass
« Reply #1 on: January 17, 2020, 12:39:40 am »
Are you sure EnumerationLiteral is an Abstract metatype?

I wouldn't know any concrete sub-meta-classes of this type.

Geert

Palm

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: extend abstract metaclass
« Reply #2 on: January 17, 2020, 01:16:58 am »
It is mentioned as an abstract metatype in the extend Metaclass window:


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: extend abstract metaclass
« Reply #3 on: January 17, 2020, 04:33:32 am »
I think EnumerationLiteral should not be in that list, but that doesn't mean it shouldn't work.

I haven't extended an abstract metaclass yet, but I guess it should work just the same.
Have you tried to change from EnumerationLiteral to Attribute, just to see if that works?

When developing MDG's there's a ton of things that can break it. In most cases it just silently fails to do anything, and it's up to you to figure out what's wrong by trial and error.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: extend abstract metaclass
« Reply #4 on: January 17, 2020, 11:03:25 am »
I think EnumerationLiteral should not be in that list, but that doesn't mean it shouldn't work.

I haven't extended an abstract metaclass yet, but I guess it should work just the same.
Have you tried to change from EnumerationLiteral to Attribute, just to see if that works?

When developing MDG's there's a ton of things that can break it. In most cases, it just silently fails to do anything, and it's up to you to figure out what's wrong by trial and error.

Geert
(My emphasis) As I experienced over a few fruitless hours yesterday.  This is SO infuriating.  "I know what's wrong!  But why should I tell you, poor punter?"

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

IanCornwell

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: extend abstract metaclass
« Reply #5 on: July 04, 2023, 11:07:52 pm »
Have you tried to change from EnumerationLiteral to Attribute, just to see if that works?

Years earlier we had done that - use Attribute as the base metaclass which our stereotype for enumeration literals extends. But when I look at it today, I wonder why we did that - an enumeration literal is not an attribute, it's a literal which is a totally different kind of thing, and it's totally unrelated in the UML metamodel and in realisations in code. About the only similarity I can see is a that adding a literal to an enum in a UML diagram is a bit like adding an attribute to a class. However I cannot see any suitable EA metaclass to choose as the base for a stereotype for enumeration literals.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: extend abstract metaclass
« Reply #6 on: July 04, 2023, 11:13:34 pm »
Years earlier we had done that - use Attribute as the base metaclass which our stereotype for enumeration literals extends. But when I look at it today, I wonder why we did that - an enumeration literal is not an attribute, it's a literal which is a totally different kind of thing, and it's totally unrelated in the UML metamodel and in realisations in code. About the only similarity I can see is a that adding a literal to an enum in a UML diagram is a bit like adding an attribute to a class. However I cannot see any suitable EA metaclass to choose as the base for a stereotype for enumeration literals.
I agree, it should not be necesarry.
However I suspect EA has internally implemented literals as a type of attributes.

You could try to send in a bug report about this, but I'm not sure if the response won't be "it's a feature, not a bug".

Geert

Johannes Echterhoff

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: extend abstract metaclass
« Reply #7 on: August 16, 2024, 05:25:25 pm »
For what it's worth (maybe for others with the same problem), we have solved it by extending "Element" instead of "EnumerationLiteral". Not ideal, I know, since the stereotype is then applicable to all model elements, not just to enumeration literals, but it works. Extending EnumerationLiteral still does not work as expected in EA 16.1.

Johannes