Book a Demo

Author Topic: The wonderful world of stereotypes  (Read 4138 times)

Marc Vanstraelen

  • EA User
  • **
  • Posts: 40
  • Karma: +6/-0
    • View Profile
The wonderful world of stereotypes
« on: April 13, 2017, 12:59:46 am »
I stumbled on some "interesting" behaviour of the stereotypes functionality in EA (I'm using version 12.1 build 1230).

Say you create a use case element and type a value in the "Stereotype" box that is not yet defined in the UML Types, e.g. "user story"
Later you use the menu Project > settings > UML Types...  to add this stereotype "user story" to the list.

When checking in the table t_stereotypes, you now have two entries with STEREOTYPE = 'user story', but interestingly:
- one has APPLIESTO = 'UseCase' (the one created by typing it directly in the element, as I found out)
- the other has APPLIESTO = 'usecase' (this is the one created via UML Types)

They both appear in the UML types dialog, but there in the "Applies to" column, both show 'usecase' (no difference in caps visible).
They also both seem to have the same GUID.

Say you now want to only use the stereotype you explicitly defined in the list. You go into UML Types and delete one, but now both have disappeared (*).
So you create it again via UML Types. All seems to work well: the elements that use the stereotype display correctly in the defined style associated to the stereotype.
But the newly created stereotype has a different GUID. The table t_xref stores in its field DESCRIPTION all stereotypes associated to an element (to allow for multiple stereotypes). Here, you'll still find the old GUID of the deleted entry. Only if you remove the stereotype and then add it again, the new GUID appears. I have no idea if this could cause issues.

All in all, using stereotypes risks creating some confusion if you don't set up some good conventions with your users...

(*) I also noticed that if you edit one of the two, both seem to change.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: The wonderful world of stereotypes
« Reply #1 on: April 13, 2017, 02:05:12 am »
Just one of the consistently inconsistent features of EA. You should consider to enable "security" to control that only admins can add new stereotypes. This way you can avoid at least this part of confusion.

q.