Purpose

This tool mentor describes how to use Rational Rose®98 to create sequence diagrams to show the interactions between objects.

Related Rational Unified Process activities

Overview

To describe the interactions between objects using sequence diagrams:

  1. Create a sequence diagram under the use case realization.
  2. Place the participating objects and actors in the sequence diagram.
  3. Describe the messages between the objects.
  4. Describe what an object does when it receives a message.

1.   Create a Sequence Diagram Under the Use Case Realization To top of page

To create a sequence diagram for a use case realization:

  1. Right-click to select the use case in the browser and make the short-cut menu visible.
  2. Select Sequence Diagram from the New option on the short-cut menu. A "NewDiagram" sequence diagram icon is added to the browser.
  3. With the new sequence diagram selected, type the name of the sequence diagram. It is recommended that you name the diagram "<use-case name> - <flow type>". This naming convention simplifies future tracing of objects to the use-case realization that they participate in.
  4. Double-click on the new sequence diagram to bring it up in the diagram window.
  5. In the documentation window, enter a brief description of the scenario that the sequence diagram depicts.

2.   Place the Participating Objects and Actors in the Sequence Diagram To top of page

To create objects in sequence diagrams:

  1. Double-click on the sequence diagram in the browser to open it up in the diagram window.
  2. Click to select the actor in the browser.
  3. Drag-and-drop the actor onto the sequence diagram.
  4. Click to select the object icon from the toolbar. The cursor changes to a cross-hair when positioned over the diagram window.
  5. Click over the desired position in the sequence diagram window to place the object.
  6. Open the Object Specification dialog box for the object, either by double-clicking on the object symbol, or by right-clicking and selecting the Specification option in the short-cut menu.
  7. In the Name field, enter the name of the object (optional).
  8. In the Class field, if not already defined, select its class from the scroll list. The scroll list contains all classes that are defined in the whole design model.
  9. Repeat the preceding steps for each object and actor in the scenario.

To show the class of an object:

  1. Open the Object Specification dialog box for the object, either by double-clicking on the object symbol, or by right-clicking and selecting the Specification option in the short-cut menu.
  2. Select the class from the Class drop-down list box.
  3. Select the OK button to close the specification.
  4. The class name is displayed in the object icon on the diagram to the right of the object’s name.

3.   Describe the Messages between the Objects To top of page

To create a message in a sequence diagram:

  1. Click to select the object message symbol from the toolbar.
  2. Click on the actor or object sending the message and drag the message line to the actor or object receiving the message.
  3. Enter the name of the message while the message line is still selected.
  4. Repeat the preceding steps for each message in the scenario.

To document a message:

  1. Open the Message Specification dialog box for the message, either by double-clicking on the message, or by right-clicking and selecting the Specification option in the short-cut menu.
  2. Enter the documentation in the Documentation field.
  3. Select OK to close the specification.

To rearrange the time order of messages in a sequence diagram, select the message arrow and drag-and-drop messages up and down the time axis to rearrange the order.

4.   Describe what an Object Does when it Receives a Message To top of page

To attach a script to a message:

  1. Select the Text Box symbol in the sequence diagram toolbar.
  2. Click on the position where you want to insert the script in the diagram.
  3. Enter the script in the text box.
  4. Select both the script and the message arrow by selecting the two symbols while holding down the shift-key.
  5. Select the Attach Script option from the Edit menu. This attaches the script to the message. Note that the script disappears if the message is removed.

Scripts can be formatted by selecting their text box and dragging the corner markers.

 

Display Rational Unified Process using frames

 

© Rational Software Corporation 1998 Rational Unified Process 5.1 (build 43)