wafaa Messages: 163 Registered: January 2010 Location: Egypt
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).
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 = ...;