About Coad Scenarios
Coad scenario is a notation of sequential interactions. You
can create Coad Scenario diagrams from a UML Sequence diagram by setting
the Notation option in Diagram Options
to Coad. If you set the Notation option this way in your global
Options (Edit | Global Options...), new sequence diagrams are created
in Coad notation.
About Collaboration
Diagrams
A collaboration diagram shows object interactions organized
around the objects and their links to each other. Unlike a sequence diagram,
a collaboration diagram shows the relationships among the objects independently
of the time sequence. Collaboration diagrams and Sequence diagrams express
similar information, but show it in different ways.
In Together, the two diagrams are closely coupled. Both diagrams
are based on a view file with a .vfSequence extension, and the navigation
icon is identical. The toolbars for the diagrams are similar, except that
the Collaboration diagram adds buttons for Association and Aggregation
links, and the Object icon does not have a "lifeline". The information
about the various diagram elements applies to both diagrams except where
noted.
You can quickly switch between two representations using the local diagram
menu Show as Collaboration and Show as Sequence respectively. When you
Browse a .vfSequence diagram icon, the diagram opens as Sequence or as
Collaboration depending on how it was last shown.
Main diagram elements
Within a sequence diagram the existence and duration of an object in
a role is shown, but the relationships among the roles are not shown.
There are Classifier Roles and Association Roles.
Within a Collaboration diagram, the relationships among the objects
typically are shown.
In Coad scenario, an Object usually contains in addition the section,
which lists operations of instantiated class.
An object role in a Sequence diagram is shown as a vertical dashed
line called the lifeline. The lifeline represents the existence of the
object at a particular time. If the object is created or destroyed during
the period of time shown on the diagram, then its lifeline starts or stops
at the appropriate point; otherwise it goes from the top to the bottom
of the diagram. An object symbol is drawn at the head of the lifeline.
In Coad scenario, the "lifeline" is represented with the column under
object symbol. Each step in time sequence corresponds to one row and messages
between objects are drawn within single row.
After creating an object with the default name, you can rename it either
directly (in-place) or using the Inspector.
Object's class
property
A key property of Object is object's class, which links the
Object to a class (see Linking Objects to a Class).
You can use the property editor for object's class to select a class
from any package available in the project... see Linking
an Object to a Class below. (For information on editing properties,
see Getting Started, Chapter 4: Editing
properties).
Message link
A message is a communication between objects that conveys information
with the expectation that action will ensue. The receipt of a message is
a kind of event. A message is shown as a horizontal solid arrow from the
lifeline of one object to the lifeline of another object. In case of a
message from an object to itself, the arrow may start and finish on the
same object symbol. The arrow is labeled with the name of the message (operation
or signal) and its argument values. The arrow may also be labeled with
a sequence number to show the sequence of the message in the overall interaction.
Sequence numbers are useful on the diagrams for identifying concurrent
threads of control.
Working with Sequence
diagrams
This section provides information about things you may need to do while
working with a Sequence diagram or its elements.
Working with Objects
Linking an Object to
a Class
You can link each Object node on the Sequence diagram to an existing class
on the Class diagram or in the Source or Class path, or you can create
a new class without leaving the Sequence diagram. The Object icon has two
sections, the Object name and the Class section, which displays the name
of the class, which the Object instantiates. The Class section only becomes
selectable after you link a Class to the Object.
To link Object to an existing class:
-
Select the Object icon on the diagram
-
Display the Object's class property
editor dialog from the Inspector Properties tab
-
Select Source path or Class path depending upon which one leads to the class
you are linking.
-
Select the Package containing the class (if necessary)
-
Select a Class from the list of existing classes displayed in the property
editor and click OK.
-
Click Apply.
Adding a new Class
To add a new Class, choose New Class from the Object
context menu. The new class's default name displays in the Object icon,
a new source file for the class is created in the current package, and
a Class node is created on the current package's Class diagram. You can
edit the name property of the class in place, and view
and edit other properties in the Inspector.
Reordering Objects
You can easily reorder the Sequence diagram, maintaining any Message links
already created between the Objects. Select any Object icon and drag it
to the desired position. Change is performed in horizontal order of objects.
You cannot make one object above or below another.
Working with Message
Links
Creating a Message link
between two Objects
To create a message from one Object to another:
-
Click on the Message button on the Sequence diagram's Toolbar
-
Click on the lifeline of the first Object at the point where you want the
link to appear and drag to the second Object.
The message is created with default name, rename it using the Inspector.
Creating
a recursive Message link
To create a message from an Object back to itself:
-
Click on the Message to Self button on the Sequence diagram's Toolbar
-
Click on the life line at the point where you want the link to appear
Creating
a Message link that calls an operation
When you create a Message link between two Objects, and the destination
Object has a Class linked to it that contains operations. Then you can
link the operation to the Message link. For such messages there is additional
tab "Operation" in the Inspector and, if you work in Diagram and Text view
mode, the operation's source code is displayed in the Text pane.
To create a Message link between two Objects:
-
Create the Message link.
-
Click on the name property in the Inspector.
-
Click on the ellipsis button.
-
The Choose operation name dialog
opens showing the list of common operations, and operations of the Class
that the Object is linked to.
-
Choose an operation. This renames the Message link to the operation's name.
-
If you do not find the desired operation, you can click Add New Operation
to create a new operation with a default name. Choose that operation and
edit it's properties in the Operation tab (see next).
If you now select this Message link, the Inspector displays two tabs on
the top. The tabs are MessageLink (Message link properties)
and Operation. The Operation tab displays the operation's properties.
TIP: You can skip the steps 2 and 3, if you drag a message line
while pressing the Shift key. Then the dialog displays immediately.
Editing Message properties
Select a message link by clicking its line. Edit message properties in
Inspector.
If the selected message is linked with some operation of the class,
then the operation's source code is displayed in the Text pane (if opened)
and the operation's properties are inspected in additional tab in the Inspector
pane.
Working in Coad scenario you can rename a message in-place by clicking
its name twice.
Reordering Message
links
Select and drag Message links up and down the Object lifeline to reorder
them. Reordering automatically updates the Message link numbers.
Sometimes you may wish to reorder message links keeping their sequential
order and freeing the space between for new links. To make such, select
a message link and drag it while pressing the Ctrl key. This action shifts
all succeeding links. If you select a number of message links (pressing
Ctrl key), then those selected are moved keeping their intervals.
Working with Collaboration
diagrams
This section provides information about things you may need to do while
working with a Collaboration diagram or its elements.
Working with Objects
Objects in the Collaboration diagram can be positioned freely in both dimensions.
The diagram context menu has Layout commands like in the Class
diagram menu.
Object names can be edited in-place. The instantiated class is assigned
the same way as in the Sequence diagram.
Working with Links
The couple of messages, which forms a number of steps in the Sequence diagram,
are represented with a single link. The link is labeled with the messages,
their order numbers, and arrows showing the direction of call.
When you select the message link line that corresponds to a number
of messages, the Inspector is disabled, since there is one inspected element.
To inspect the properties of single message, click the corresponding label
above the link. The same way you can delete either single message or the
whole link together with all the messages depending on what selected.
In addition to message links, the Collaboration diagram enables to
create Association and Aggregation links between objects. Note that these
associations are not source-based and are not mapped from the Class diagram
associations.
Chapter contents
About Sequence
diagrams
About Collaboration diagrams
Main diagram elements
Working with Sequence
diagrams
Working with Objects
Linking an Object
to a Class
Adding a new
Class
Reordering Objects
Working with Message Links
Creating a Message
link between two Objects
Creating a recursive
Message link
Creating a Message link
that calls an operation
Editing Message
properties
Reordering Message
links
Working with Collaboration
diagrams
Working with Objects
Working with Links
© 1997-98
This page is hosted by the Chair for Applied Software Engineering of the Technische Universität München.
Imprint (Impressum)