Book a Demo

Author Topic: Wrong Stereotype applied to an element  (Read 7942 times)

Janic Vachon

  • EA User
  • **
  • Posts: 24
  • Karma: +2/-0
    • View Profile
Wrong Stereotype applied to an element
« on: January 09, 2016, 04:11:08 am »
Hi there,

I need your input please. I want to know if its a feature or a bug. I tested it in EA 12 and this is the behavior that I got. I browsed the web and this forums and couldn't find anything. Here it goes :

We have an UML profile (without MDG technology for some reasons) and I was wondering why some of our elements weren't getting theirs taggeds values synchronized with the desired stereotype. I found why : They had the good stereotype with the correct spelling, but the metaclass (BaseElement in EA) related to the stereotype isn't the good one. Here is some explanations :

When you look into the t_stereotype table (or in Project>Settings>UML Types from the EA UI), you know that a stereotype is a group of a stereotype applied to a metaclass (BaseElement in EA). We happen to have some groups of the same stereotype with different BaseElement. For example :
Stereotype name|AppliesTo (BaseElement or metaClass)
application|component
application|class

So when an user drag a new "Class" in a diagram and type in "application". EA gives the group of "application*class" to this element. But using a class to define an application is wrong. It has to be a component. So you got to change the type to Component. (Element>Advanced>Change Type)

The "Change type" doesn't seem to change the stereotype group "application*class" to "application*component". Since the first combination is not related to the UML profile, these objects won't get theirs tagged values synchronized.

So it is a feature or a bug?

Thank you for your help,

Janic

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Wrong Stereotype applied to an element
« Reply #1 on: January 09, 2016, 04:36:32 am »
I'd say: a feature. Either you get rid of the stereotypes in t_stereotypes (Project/Settings/UML...) or you use a different name.

q.

Janic Vachon

  • EA User
  • **
  • Posts: 24
  • Karma: +2/-0
    • View Profile
Re: Wrong Stereotype applied to an element
« Reply #2 on: January 09, 2016, 06:59:54 am »
Hi there, thanks for the reply q.

I just ran into a strange behavior that is similar to my previous post. Lets say we still have the same two stereotypes in the t_stereotypes table :
Stereotype name|AppliesTo (BaseElement or metaClass)
librairie|component
librairie|class

When I create a new "component" and type in the stereotype "librairie", it gives the group "librairie*class" instead of "librairie*component". Why would it match the wrong stereotype with the wrong object's base class?

Any hints on this? I know I could get rid of the undesired stereotypes, but i got 60 users, so there will always be undesired stereotypes created until we enable the built-in security feature.

So, in this case, is it a bug or a feature?

Thanks,

Janic
« Last Edit: January 09, 2016, 07:34:36 am by Janic Vachon »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Wrong Stereotype applied to an element
« Reply #3 on: January 09, 2016, 08:06:03 am »
Hmm, strange. I created a stereo for class and component with the same name. For the class the stereotype selector show "class" but for the component it shows "component,class". This is strange and I have no explanation for that. Also it seems that the shape script defined for the class is also used for the component. But when I define also a shape script for the component everything appears at it should.

I'd regard this a bug - except the Sparxians have an excuse (which they often have; though not always a good one).

q.

Janic Vachon

  • EA User
  • **
  • Posts: 24
  • Karma: +2/-0
    • View Profile
Re: Wrong Stereotype applied to an element
« Reply #4 on: January 09, 2016, 08:56:41 am »
Yeah well, I think it will be much simpler to just clean the unwanted stereotypes.

Thanks for your time q.

Janic

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Wrong Stereotype applied to an element
« Reply #5 on: January 11, 2016, 09:06:39 am »
My suspicion is that it's because UML::Component is a specialization of UML::Class, so when choosing which stereotype to apply, EA finds one and asks itself "This stereotype extends Class, can I apply it to a Component? A Component is a Class, so yes I can", and then stops looking for a better stereotype.
The Sparx Team
[email protected]

Janic Vachon

  • EA User
  • **
  • Posts: 24
  • Karma: +2/-0
    • View Profile
Re: Wrong Stereotype applied to an element
« Reply #6 on: January 12, 2016, 02:15:43 am »
Ok, thanks for the reply KP.

That might explain a lot of things that we are experiencing with an UML Profil. So manually typing new objects' stereotype is not a good idea, because EA can apply a much larger range of meta class than the one used in the UML Profile.

We always got to use the UML Profil Toolbox (or the ressource view, or ...) to create elements associated to the UML Profile.

Thanks again, it is much appreciated.

Janic
« Last Edit: January 12, 2016, 02:20:20 am by Janic Vachon »

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Wrong Stereotype applied to an element
« Reply #7 on: January 12, 2016, 07:47:07 am »
If you use the "stereotype for" dialog you can select the profile and stereotype at the same time.

Janic Vachon

  • EA User
  • **
  • Posts: 24
  • Karma: +2/-0
    • View Profile
Re: Wrong Stereotype applied to an element
« Reply #8 on: January 12, 2016, 08:25:42 am »
Yeah, I did test that. Even if the good profile and stereotype are selected, in the DB, the reference in the t_xref is on the wrong stereotype. So the tagged values aren't synced. I believe that selecting the good profile and stereotype in the element's stereotype dropdownlist only put the good spelling of the stereotype in the textbox. Then, EA tries to match it with a known stereotype and I get the same problem as above.

Thanks,

Janic
« Last Edit: January 12, 2016, 08:54:52 am by Janic Vachon »