Author Topic: Classifier's stereotype kept on instanciation  (Read 4367 times)

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1374
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Classifier's stereotype kept on instanciation
« on: June 10, 2014, 11:10:49 pm »
Hi,
Is there any way to keep a class stereotype when creating an instance?

I have "client" and "server" stereotyped classes ; when creating a lifeline on a sequence diagram, can I tell EA to apply the class "client" or "server" stereotype on the instance/lifeline?

thanks
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Classifier's stereotype kept on instanciation
« Reply #1 on: June 11, 2014, 08:40:41 am »
You can assign it manually. However, I think that the stereotype from the classifier should be applied automatically. Looks like a bug to me, but I'm not that firm in the Superstructures. Maybe someone from Sparx could comment.

You should report that as bug anyway to see what they state officially.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Classifier's stereotype kept on instanciation
« Reply #2 on: June 11, 2014, 09:33:59 am »
In general a stereotype on a classifier can't be applied to an instance because the instances are a different type of element.

However, in general the appearance of an instance is intended to match that of the classifier. (But with underlined name and : <classifier>) From the top of my head I don't know if the specification is explicit about displaying stereotypes from the classifier. It may be that it is appropriate to draw the stereotype even though it isn't explicitly defined.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Classifier's stereotype kept on instanciation
« Reply #3 on: June 11, 2014, 07:27:16 pm »
At least EA is consistent in the way they apply that pattern. If you create an instance of a class the stereotype isn't copied too. Geert seems to be absent at the moment. He might have more insight in what OMG meant to happen in this case.

q.

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1374
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Classifier's stereotype kept on instanciation
« Reply #4 on: June 11, 2014, 07:31:31 pm »
I think that copying the classifier's stereotype to its instance should be optional so this is more an enhancement request than a bug report.

e.g when creating an instance of a class, EA would prompt the option "Apply the classifier's stereotype to the instance" (default value : disabled).

Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Classifier's stereotype kept on instanciation
« Reply #5 on: June 11, 2014, 07:35:55 pm »
I guess that way would make everyone happy. But on a short term that means you'd need to script that with an add-in listening to some of the OnPost events.

q.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Classifier's stereotype kept on instanciation
« Reply #6 on: June 12, 2014, 09:03:48 am »
It is possible to do this in a profile. Search the help for "_instanceType" for details.

In short, what you do is define a stereotype that extends "Class" (or any other classifier type), define a stereotype that extends either "Object" or "Part", and give the first stereotype an attribute "_instanceType" that names the second stereotype. There's more to it than that, but it's all in the help...
The Sparx Team
[email protected]