Working with an Instance Specification - UML 2.0
Go Up to Class Diagram Procedures
You can instantiate a classifier using the Object Inspector or the in-place editor.
Use the following techniques with an instance specification:
- Instantiate a classifier using the Object Inspector.
- Instantiate a classifier using the in-place editor.
- Define the features of an instance specification.
- Add a slot to an instance specification element.
- Associate a slot with a structural feature.
- Set the slot value.
- Define the slot stereotype.
To instantiate a classifier using the Object Inspector
- Select an instance specification in your diagram.
- In the General node of the Object Inspector, select the instantiates field.
- Click the chooser button.
- In the Choose Class or Interface for Type dialog box, select the classifiers from the available contents, using the Add and Remove buttons.
- Click OK when ready.
To instantiate a classifier using the in-place editor
- Select an instance specification in your diagram.
- Press F2 to open the in-place editor. Alternatively, click twice on the instance specification name.
- Type the name of an existing classifier, delimited by a colon, next to the instance specification name. For example, InstanceSpecifcation1:Class1.
- Press Enter.
To define the features of an instance specification
- Insert slots into an instance specification element.
- Associate the slots with the attributes of the instantiated classifiers.
- Set the value and define the slot stereotype.
To add a slot to an instance specification element
- Add an instance specification element to your diagram.
- Right-click the instance specification element on your diagram and choose New > Slot on the context menu.
To associate a slot with a structural feature
- Select a slot in an instance specification element.
- Expand the General node of the Object Inspector.
- In the defining feature field, click the chooser button.
- In the Choose Attribute for Defining Feature dialog box, select the desired attribute and click OK.
To set the slot value
- Choose a slot.
- Do one of the following:
- In the Object Inspector of the slot, type the desired string in the value field.
- Invoke the in-place editor for the slot and type the value next to the slot name, delimited by an equal sign.
To define the slot stereotype
- In the Object Inspector of the slot, expand the General node.
- In the Stereotype filed, enter the stereotype value.