Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Palm on January 16, 2020, 08:59:15 pm

Title: extend abstract metaclass
Post by: Palm 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
Title: Re: extend abstract metaclass
Post by: Geert Bellekens 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
Title: Re: extend abstract metaclass
Post by: Palm on January 17, 2020, 01:16:58 am
It is mentioned as an abstract metatype in the extend Metaclass window:

(http://)
Title: Re: extend abstract metaclass
Post by: Geert Bellekens 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
Title: Re: extend abstract metaclass
Post by: Paolo F Cantoni 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
Title: Re: extend abstract metaclass
Post by: IanCornwell 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.
Title: Re: extend abstract metaclass
Post by: Geert Bellekens 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
Title: Re: extend abstract metaclass
Post by: Johannes Echterhoff 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