Tool Mentor: Using Rational Rose® to Manage
Collaboration Diagrams
Purpose
This tool mentor describes how to use Rational Rose®98 to create collaboration
diagrams to show the interactions between objects.
Related Rational Unified Process activities
Overview
To describe the interactions between objects using collaboration diagrams:
- Create a
collaboration diagram under the use case realization.
- Creating an object in a collaboration diagram.
- Creating links between the objects.
- Creating messages between objects.
To create a collaboration diagram under the Use-Case Realization:
- Right-click to select the use-case realization in the browser and make the short-cut
menu visible.
- Select Collaboration Diagram from the New option on the short-cut menu. A
"NewDiagram" collaboration diagram icon is added to the browser.
- With the new collaboration diagram selected, type the name of the diagram. 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.
- Double-click on the new collaboration diagram to bring it up in the diagram window.
To create an object in a collaboration diagram:
- Double-click on the collaboration diagram in the browser to open it up in the diagram
window.
- Click to select the actor in the browser.
- Drag-and-drop the actor onto the collaboration diagram.
- Click to select the object icon from the toolbar. The cursor changes to a cross-hair
when positioned over the diagram window.
- Click over the desired position in the collaboration diagram window to place the object.
- 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.
- In the Name field, enter the name of the object (optional).
- 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.
- Repeat the preceding steps for each object and actor in the use-case realization.
Links provide a way for two objects/actors to exchange messages. To create a link
between two objects in a collaboration diagram, do the following:
- Double-click on the collaboration diagram in the browser to open the diagram.
- Click to select the link symbol from the toolbar.
- Click on the actor or object on one end of the link and drag the message line to the
actor or object at the other end of the link.
- Repeat the preceding steps for each link required between objects or actors in the
scenario.
To create messages in the collaboration diagram between two objects, do the following:
- Select the Object Link symbol from the collaboration diagram toolbar.
- Left-click on the sending object and drag it to the destination object. An object link
is created between the two objects.
- Select the Link Message symbol from the collaboration diagram toolbar.
- Left-click on the created object link. This creates an anonymous link message.
- Right-click on the link message. This displays the full interface of the destination
object in a pop-up list.
- Select the relevant operation from the pop-up list. This inserts the operation in the
collaboration and assigns it the next available collaboration number.
To create a message from an object to the object itself, do the following:
- Select the Link to Self symbol from the collaboration diagram toolbar.
- Left-click on the designated object to insert the recursive link.
- Select Link Message from the toolbar.
- Left-click on the inserted link to add a message arrow to the link.
- Right-click to open a list of operations on the object.
- You may now select one of the existing operations or select the <new operation>
alternative to create a new operation on the objects class.
- If a new operation is created, an Operation Specification dialog box for this
operation is opened. Give the new operation a name and a brief description. Click OK.
Right-click on the message arrow again and select the new operation, which now appears on
the list.
- The name of the selected operation is displayed as the name of the link message.
To select or deselect the collaboration number display, do the following:
- Select Options
from the Tools menu to open the Options dialog
box.
- Select the Diagram tab.
- Select or deselect the Collaboration Numbering check box.
- Click OK to close the Options dialog box.
|