Book a Demo

Author Topic: What's the deal with the «enum» stereotype?  (Read 11648 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
What's the deal with the «enum» stereotype?
« on: March 27, 2018, 04:29:05 pm »
For a while now I've noticed something strange.
On some models, when I add a value to an enumeration, this new value automatically gets the stereotype «enum»

On other models the stereotype is not there.

Does anyone know where this stereotype is coming from, and why I have this on some models an not on others?

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: What's the deal with the «enum» stereotype?
« Reply #1 on: March 27, 2018, 05:46:54 pm »
For a while now I've noticed something strange.
On some models, when I add a value to an enumeration, this new value automatically gets the stereotype «enum»

On other models the stereotype is not there.

Does anyone know where this stereotype is coming from, and why I have this on some models an not on others?

Geert
I can't help with your questions Geert, but I can confirm that «enum» is a very special thing and behaves differently from other stereotypes.

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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: What's the deal with the «enum» stereotype?
« Reply #2 on: March 27, 2018, 07:03:51 pm »
It's not a stereotype. It just looks like one (UML "speciality"). Enumeration is a keyword. On p. 99:
Quote
Any keywords (including stereotype names) should also be centered in plain face within guillemets above the Classifier name. If multiple keywords and/or stereotype names apply to the same model element, each may be enclosed in a separate pair of guillemets and listed one after the other. Alternatively they may all appear between the same pair of guillemets, separated by commas.

q.
« Last Edit: March 27, 2018, 07:08:36 pm by qwerty »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: What's the deal with the «enum» stereotype?
« Reply #3 on: March 27, 2018, 08:53:09 pm »
I don't see any mention of an «enum» keyword in the UML specs.

I'm talking about the stereotype on the EnumerationLiterals, not about the «enumeration» keyword you see on the Enumeration.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: What's the deal with the «enum» stereotype?
« Reply #4 on: March 27, 2018, 09:57:27 pm »
Right. EA assigns that stereotype to attributes being used as enumeration literals. As per UML spec they are EnumerationLiterals and not stereotyped. However, one is free to add stereotypes at will. I'd guess that it was the will of one Sparxian to add this stereotype.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: What's the deal with the «enum» stereotype?
« Reply #5 on: March 28, 2018, 04:06:55 am »
Right. EA assigns that stereotype to attributes being used as enumeration literals. As per UML spec they are EnumerationLiterals and not stereotyped. However, one is free to add stereotypes at will. I'd guess that it was the will of one Sparxian to add this stereotype.

q.

It does, but not everywhere. In some models it does and in others it doesn't.
I'm trying to figure out what controls this behavior. (figuring out the raison d'être for this stereotype would be a bonus)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: What's the deal with the «enum» stereotype?
« Reply #6 on: March 28, 2018, 06:03:26 am »
If you delete the stereotype, EA does not seem to care. It's obviously some kind of redundant no-op. Maybe older EA versions needed it?

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: What's the deal with the «enum» stereotype?
« Reply #7 on: March 28, 2018, 09:07:01 am »
The «enum» stereotype on an enumeration literal is added to Java enumerations. It was added when Java added support for enumerations, which included normal attributes as well. A stereotype was used on the literals to distinguish them from the attributes.

Set the language of your enumeration to <none> and the stereotype shouldn't show up again.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: What's the deal with the «enum» stereotype?
« Reply #8 on: March 28, 2018, 11:07:03 am »
The «enum» stereotype on an enumeration literal is added to Java enumerations. It was added when Java added support for enumerations, which included normal attributes as well. A stereotype was used on the literals to distinguish them from the attributes.

Set the language of your enumeration to <none> and the stereotype shouldn't show up again.
We tried setting our standard language to other than Java  (and we thought we had reset the repository - using Update Package Status...) but EA still creates some things with the Java Language Property. Is there more than one place to set this and is it set on a per-instance, per-repository or per-user basis?

Paolo
« Last Edit: March 28, 2018, 11:12:07 am by Paolo F Cantoni »
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: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: What's the deal with the «enum» stereotype?
« Reply #9 on: March 28, 2018, 02:29:17 pm »
The «enum» stereotype on an enumeration literal is added to Java enumerations. It was added when Java added support for enumerations, which included normal attributes as well. A stereotype was used on the literals to distinguish them from the attributes.

Set the language of your enumeration to <none> and the stereotype shouldn't show up again.

Thanks Simon, that's exactly the information I was looking for.  :)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: What's the deal with the «enum» stereotype?
« Reply #10 on: March 28, 2018, 05:51:31 pm »
is it set on a per-instance, per-repository or per-user basis?

Paolo
Most of the settings are per user since being stored in the registry.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: What's the deal with the «enum» stereotype?
« Reply #11 on: March 29, 2018, 10:41:22 am »
is it set on a per-instance, per-repository or per-user basis?

Paolo
Most of the settings are per user since being stored in the registry.

q.
I'll try to confirm that since it's quite annoying.

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