Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Must the stereotype of an Object in UML match the stereotype for its Class' stereotype ?(is this statement true or not)
Must the stereotype of an Object in UML match the stereotype for its Class' stereotype ? [message #537862] Thu, 03 June 2010 21:51 Go to next message
wafaa is currently offline wafaaFriend
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
hi all

can some one tell me if the coming statement true or not :


the stereotype of an Object in UML must match the stereotype for its Class' stereotype

if it is true, in Eclipse after creating the profile it generates error when validating it , due to same name is used for more than one stereotype.

how can I solve this problem

[Updated on: Thu, 03 June 2010 22:18]

Report message to a moderator

Re: Is the stereotype of an Object in UML must match the stereotype for its Class' stereotype ? [message #538009 is a reply to message #537862] Fri, 04 June 2010 13:30 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, wafaa,

Where did you read this statement? Stereotypes are extensions of UML
model elements. A profile may define constraints for its stereotypes
that restrict how they can be applied to model elements according to the
relationships between those elements, but those constraints are for the
profile modeler to define.

The warning about same-named stereotypes is just a case of the general
constraint that named elements in a namespace must be distinguishable.
Note that a stereotype can extend more than one metaclass if it makes
sense for it to be applied to elements of those different kinds.

The newsgroup can better help to solve the problem if you explain what
you are attempting to accomplish.

HTH,

Christian


On 03/06/10 05:51 PM, wafaa wrote:
> hi all
>
> can some one tell me if the coming statement rue or not :
>
> the stereotype of an Object in UML must match the stereotype
> for its
> Class' stereotype
>
> if it is true, in Eclipse after creating the profile it generates error
> when validating it , due to same name is used for more than one stereotype.
>
> how can I solve this problem
Re: Is the stereotype of an Object in UML must match the stereotype for its Class' stereotype ? [message #538126 is a reply to message #538009] Sat, 05 June 2010 12:29 Go to previous messageGo to next message
wafaa is currently offline wafaaFriend
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
hi Christian and thanks a lot
What I understand from your reply is that in a single namespace, there should be no similar names!!



Actually I have stereotype named 'OntClass' once used for metaclass Class and the same name stereotype is used for InstanceSpecification metaclass,
also Stereotyped range used used for association and the same name is used for property metaclass, and so on
they should have different name as they are in the same namespace!! (should they ?) ,

so it generated error
'there may not be two classifiers named 'OntClass'


So I have to use different names even if it is between class and object (MEaclass and InstanceSpecification)
I read it in a paper if you would like to have I will give you its link


-------------------------------------------

another question, you mentioned some thing related to constraint,
could you please tell me how to add constraint to a stereotype

thanks in advanced

[Updated on: Sat, 05 June 2010 12:36]

Report message to a moderator

Re: Is the stereotype of an Object in UML must match the stereotype for its Class' stereotype ? [message #538374 is a reply to message #538126] Mon, 07 June 2010 13:23 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, wafaa,

See some replies in-line, below.

HTH,

Christian


On 05/06/10 08:29 AM, wafaa wrote:
> hi Christian and thanks a lot
> What I understand from your reply is that if the name space is
> distinguishable, so same name could be used for different mmetaclasses'
> stereotypes.

The distinguishability of any two named elements is only defined in the
context of a namespace of which they are members, and specifically when
they are members of the same namespace. Stereotypes can only be *owned*
by Profiles, and it is probably quite uncommon for stereotypes to be
imported into other profiles. So, you can assume that for stereotypes,
a profile cannot have two stereotypes that have the same name. The
metaclasses that these stereotypes extend has nothing to do with
stereotype names or distinctness.

My remark about metaclass extensions was meant simply to say that you
don't necessarily have to define an OntClass stereotype for Class and an
OntClass stereotype for InstanceSpecification because you can have just
one OntClass that extends *both* Class and InstanceSpecification. Of
course, if you need to have different stereotype attributes for classes
as for instances, then you would need two stereotypes having different
names, OntClass and OntInstance.


> Actually I have stereotype named 'OntClass' once used for metaclass
> Class and for InstanceSpecification metaclass,
> also Stereotyped range used used for association and for property, and
> so on
> they should have different name space (should they ?) , but though it
> generated error 'there may not be two classifiers named 'OntClass'

All stereotypes in a profile have the same namespace: the profile is
their namespace.


> and the same for the rest.
>
> I do not know what should be done in such case,
>
> another question, you mentioned some thing related to constraint,
> could you please tell me how to add constraint to a stereotype

In the UML editor, right-click on the Stereotype and add an "Owned Rule
-> Constraint".


> thanks in advanced
>
>
Re: Is the stereotype of an Object in UML must match the stereotype for its Class' stereotype ? [message #539126 is a reply to message #538374] Wed, 09 June 2010 17:33 Go to previous message
wafaa is currently offline wafaaFriend
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
hi Christian,
Actually You gave me the clue, I can extend both metaclasses thanks alot,
and let me ask some questions if you do not mind:

1- about constraint applied on the stereotype tagged values, what is a tagged value, property having default value and stereotype??,

2- due to my few knowledge about ocl, I want it to be expression, mathematical or logical not just some words,

3- is Constraint triggered when applying the stereotypes and its tagged values to a model or the user should read it and take care of such specification.

I know I have no background about using OCL in UML so, if you have good tutorial I will be thankful.

thanks alot dear


Re: Is the stereotype of an Object in UML must match the stereotype for its Class' stereotype ? [message #628494 is a reply to message #537862] Fri, 04 June 2010 13:30 Go to previous message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, wafaa,

Where did you read this statement? Stereotypes are extensions of UML
model elements. A profile may define constraints for its stereotypes
that restrict how they can be applied to model elements according to the
relationships between those elements, but those constraints are for the
profile modeler to define.

The warning about same-named stereotypes is just a case of the general
constraint that named elements in a namespace must be distinguishable.
Note that a stereotype can extend more than one metaclass if it makes
sense for it to be applied to elements of those different kinds.

The newsgroup can better help to solve the problem if you explain what
you are attempting to accomplish.

HTH,

Christian


On 03/06/10 05:51 PM, wafaa wrote:
> hi all
>
> can some one tell me if the coming statement rue or not :
>
> the stereotype of an Object in UML must match the stereotype
> for its
> Class' stereotype
>
> if it is true, in Eclipse after creating the profile it generates error
> when validating it , due to same name is used for more than one stereotype.
>
> how can I solve this problem
Re: Is the stereotype of an Object in UML must match the stereotype for its Class' stereotype ? [message #628497 is a reply to message #538009] Sat, 05 June 2010 12:29 Go to previous message
wafaa is currently offline wafaaFriend
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
hi Christian and thanks a lot
What I understand from your reply is that if the name space is distinguishable, so same name could be used for different mmetaclasses' stereotypes.

Actually I have stereotype named 'OntClass' once used for metaclass Class and for InstanceSpecification metaclass,
also Stereotyped range used used for association and for property, and so on
they should have different name space (should they ?) , but though it generated error
'there may not be two classifiers named 'OntClass'

and the same for the rest.

I do not know what should be done in such case,

another question, you mentioned some thing related to constraint,
could you please tell me how to add constraint to a stereotype

thanks in advanced
Re: Is the stereotype of an Object in UML must match the stereotype for its Class' stereotype ? [message #628501 is a reply to message #628497] Mon, 07 June 2010 13:23 Go to previous message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, wafaa,

See some replies in-line, below.

HTH,

Christian


On 05/06/10 08:29 AM, wafaa wrote:
> hi Christian and thanks a lot
> What I understand from your reply is that if the name space is
> distinguishable, so same name could be used for different mmetaclasses'
> stereotypes.

The distinguishability of any two named elements is only defined in the
context of a namespace of which they are members, and specifically when
they are members of the same namespace. Stereotypes can only be *owned*
by Profiles, and it is probably quite uncommon for stereotypes to be
imported into other profiles. So, you can assume that for stereotypes,
a profile cannot have two stereotypes that have the same name. The
metaclasses that these stereotypes extend has nothing to do with
stereotype names or distinctness.

My remark about metaclass extensions was meant simply to say that you
don't necessarily have to define an OntClass stereotype for Class and an
OntClass stereotype for InstanceSpecification because you can have just
one OntClass that extends *both* Class and InstanceSpecification. Of
course, if you need to have different stereotype attributes for classes
as for instances, then you would need two stereotypes having different
names, OntClass and OntInstance.


> Actually I have stereotype named 'OntClass' once used for metaclass
> Class and for InstanceSpecification metaclass,
> also Stereotyped range used used for association and for property, and
> so on
> they should have different name space (should they ?) , but though it
> generated error 'there may not be two classifiers named 'OntClass'

All stereotypes in a profile have the same namespace: the profile is
their namespace.


> and the same for the rest.
>
> I do not know what should be done in such case,
>
> another question, you mentioned some thing related to constraint,
> could you please tell me how to add constraint to a stereotype

In the UML editor, right-click on the Stereotype and add an "Owned Rule
-> Constraint".


> thanks in advanced
>
>
Re: Is the stereotype of an Object in UML must match the stereotype for its Class' stereotype ? [message #628504 is a reply to message #538374] Wed, 09 June 2010 17:33 Go to previous message
wafaa is currently offline wafaaFriend
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
hi Christian,
Actually You gave me the clue, I can extend both metaclasses thanks alot,
and let me ask some questions if you do not mind:

1- about constraint applied on the stereotype tagged values, what is a tagged value, property having default value and stereotype??,

2- due to my few knowledge about ocl, I want it to be expression, mathematical or logical not just some words,

3- is Constraint triggered when applying the stereotypes and its tagged values to a model or the user should read it and take care of such specification.

I know I have no background about using OCL in UML so, if you have good tutorial I will be thankful.

thanks alot dear
Previous Topic:Help! Not understanding state machine diagram to implementation
Next Topic:Re: SOS advise from EMF specialist
Goto Forum:
  


Current Time: Fri Apr 19 13:33:29 GMT 2024

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

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

Back to the top