Associating an Object with a Classifier - UML 1.5

From RAD Studio
Jump to: navigation, search

Go Up to Interaction Diagram Procedures

In the sequence or collaboration diagram you can create associations between objects (located on an interaction diagram) and classifiers (located on some class diagram). Instantiated classes for an object can be selected from the model, or the classes can be created and added to the model.

The range of available classifiers depends on the project type.

  • Design projects: classes, interfaces
  • Implementation projects: classes, interfaces, structures

To associate an object with an existing classifier:

  1. Select an object.
  2. On the context menu of the object, select Choose class.
  3. The submenu displays the list of available classifiers. If you cannot find the required classifier in the list, click More to reveal the model tree view.
  4. In the Choose Type to Instantiate dialog box that opens, select a classifier from the model and click OK.

Tip: Alternatively, use the Object Inspector. Click the Instantiates field and select the classifier from the model.

Result: The object displays the fully qualified path to the instantiated classifier.

To create a new classifier for an existing object:

  1. Select an object.
  2. On the context menu, choose Add.
  3. From the submenu, choose the desired classifier type.

Result: A new classifier is added to the model. A shortcut for the new classifier appears on the interaction diagram in question, connected with the object by a dependency link.

To unlink an object:

  1. Select an object.
  2. On the context menu of the object choose Unlink class.

Result: The association is removed, but the classifier is preserved in the model.

To navigate between classifiers and objects:

  1. Select the object on the diagram.
  2. Right-click and choose Synchronize Model View on the context menu to move focus to this classifier in the Model View, or choose Go to Class Definition to open this classifier in the source code (for implementation projects).

To create a shortcut to a classifier on an interaction diagram:

  1. On the diagram, select an object that instantiates a classifier.
  2. Right-click and choose Import class on the context menu.

Result: A shortcut to the instantiated classifier is added to the diagram.

See Also