Skip to main content



      Home
Home » Modeling » UML2 » Sterotypes
Sterotypes [message #626704] Fri, 13 June 2008 10:16
Eclipse UserFriend
Hello all

I'm developing a plugin which takes a UML file and according to a
multiplicity stereotype instantiate it.

I wrote here an example and its a bit long so whoever reads it understand
my problem better,
so please bear with me.

Lets say that I have a class diagram file called a.uml with the following
classes:

1. class Student that has multiplicity 2..2 with the following properties:
name with multiplicity 1..1
id with multiplicity 2..2

2. Class Lecturer that has multiplicity 1..1 with the following properties:
name with multiplicity 4..4
id with multiplicity 4..4

My plugin will creates a new UML class diagram with the number of
instances for each class in the a.uml according to their multiplicity,
thus I will have:

2 Students
1 Lecturer

each student has 1 instance of the property called name and 2 instances of
the property called id

the lecturer has 4 instances of the property called name
and 4 instances of the property called id

My plugin also creates a Profile that accordingly for each element in a.uml
creates a stereotype with an attribute called path that has the uri of the
element and sets the stereotype name to be the element name.

you can say that these stereotypes are classifiers.

so in this example I will have the following stereotypes:

stereotype called Student
with the property path that has the value of Student.uri

stereotype called name
with the property path that has the value of Student.name.uri

stereotype called id
with the property path that has the value of Student.id.uri

stereotype called Lecturer
with the property path that has the value of Lecturer.uri

stereotype called name
with the property path that has the value of Lecturer.name.uri

stereotype called id
with the property path that has the value of Lecturer.id.uri


Finally!! :-) my problem is:


After defining the profile and applying it to the new class diagram

some how when applying stereotypes with the same name to different
instances in my new class diagram, the applied stereotype for them is only
the first one and the other stereotypes are ignored.

all of the I'm doing of course programmatically.

so in this example the instance of Student.name will be applied with the
sterotype for Student.name which is good, but also the instance of
Lecturer.name will be applied with the same stereotype instead of the
stereotype for Lecturer.name.

does anyone have any idea why this happens ?

thx for any help,
if you need me to post my code I'll be more the happy :-)

thx again
Previous Topic:UML 2 Plugin
Next Topic:Cannot load applied profiles
Goto Forum:
  


Current Time: Sun Jul 06 23:31:56 EDT 2025

Powered by FUDForum. Page generated in 0.24114 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top