Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » slot defining feature
slot defining feature [message #628506] Thu, 10 June 2010 10:34 Go to next message
wafaa is currently offline wafaa
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 #628509 is a reply to message #628506] Fri, 11 June 2010 02:15 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael Chaves
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 have slots. Classifiers have structural features. An instance of a classifier 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 #628511 is a reply to message #628509] Sat, 12 June 2010 07:54 Go to previous messageGo to next message
wafaa is currently offline wafaa
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 #628514 is a reply to message #628511] Sat, 12 June 2010 14:25 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael Chaves
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 #628520 is a reply to message #628514] Sat, 19 June 2010 06:55 Go to previous message
wafaa is currently offline wafaa
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
yes, thanks a lot Rafeal,
I got your point.
Previous Topic:slot defining feature
Next Topic:Applying UML Profile Programmatically
Goto Forum:
  


Current Time: Fri Aug 29 12:21:51 EDT 2014

Powered by FUDForum. Page generated in 0.09969 seconds