Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » slot defining feature
slot defining feature [message #539362] Thu, 10 June 2010 14:34 Go to next message
wafaa is currently offline wafaaFriend
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
hi all

I want to know how to use the function called
setDefiningFeature (StructuralFeature value);

I mean what are the known information about the value if I want to create it my hand.

it should reference some thing existing but I know its info like
name, owner of it, type and so

how to use them to create new defining feature and set it in the owning slot.

My question might be not logical if it is using editor but through transformation which is my case might be logical

thanks alot
wafaa

Re: slot defining feature [message #539506 is a reply to message #539362] Fri, 11 June 2010 06:15 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 161
Registered: July 2009
Senior Member
From the Slot interface:

"StructuralFeature org.eclipse.uml2.uml.Slot.getDefiningFeature()

Returns the value of the 'Defining Feature' reference. The structural feature that specifies the values that may be held by the slot."

Instances can have one or more classifiers. Instances contain slots. Classifiers have structural features. An instance can have one slot for each structural feature (i.e. property) in its classifier(s).

HTH,

Rafael
http://abstratt.com/blog

[Updated on: Fri, 11 June 2010 06:16]

Report message to a moderator

Re: slot defining feature [message #539736 is a reply to message #539506] Sat, 12 June 2010 11:53 Go to previous messageGo to next message
wafaa is currently offline wafaaFriend
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
thanks Rafeal for your reply,
I understand your view but I mean, can I create it rather than referencing it or getting it.
I mean can I point to the classifier property (the defining feature of the slot) if I know its information.

as the same way we create property of association when we know for example the ends type.


thanks alot again


Rafael Chaves wrote on Fri, 11 June 2010 09:15
From the Slot interface:

"StructuralFeature org.eclipse.uml2.uml.Slot.getDefiningFeature()

Returns the value of the 'Defining Feature' reference. The structural feature that specifies the values that may be held by the slot."

Instances can have one or more classifiers. Instances contain slots. Classifiers have structural features. An instance can have one slot for each structural feature (i.e. property) in its classifier(s).

HTH,

Rafael
http://abstratt.com/blog



Re: slot defining feature [message #539765 is a reply to message #539736] Sat, 12 June 2010 18:25 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 161
Registered: July 2009
Senior Member
I am not sure I understand what you want to do.

You should not create a new structural feature to link from the slot defining feature. What you want to do is to set the defining feature of a slot by retrieving the corresponding *existing* property from one of the classifiers your instance has. For example:

Class myClass = ...;
InstanceSpecification myInstance = ...;
myInstance.getClassifiers().add(myClass);

Slot fooSlot = myInstance.createSlot();
Property fooProperty = myClass.getOwnedAttribute("foo", null);
fooSlot.setDefiningFeature(fooProperty);

To be fair, the fact that UML talks about attributes, properties and structural features when referring to the same thing is not really helpful.

HTH,

Rafael
http://abstratt.com/blog/
Re: slot defining feature [message #541275 is a reply to message #539765] Sat, 19 June 2010 10:55 Go to previous message
wafaa is currently offline wafaaFriend
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
yes, thanks a lot Rafeal,
I got your point.
Previous Topic:linkEnd
Next Topic:slot defining feature
Goto Forum:
  


Current Time: Thu Apr 18 10:40:51 GMT 2024

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

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

Back to the top