Sequence Diagrams Editor
Sequence Diagrams Editor
A Sequence Diagram (SD) shows the interactions between objects of a system. UMLAUT
allows to create sequence diagrams at the specification level (with
ClassifierRoles and Messages).
You can find the same facilities than in other UMLAUT views editors:
- Drag and drop: select a Message or a ClassifierRole from the browser, drag and drop it to the sequence view. Note: if this doesn't work (because of a bug in the jdk), an alternative way is to use the "Copy reference"/"Drop reference" functions of the pop-up menus.
- Zoom In/Out of the diagram
- Print the view
The following sections give you information on:
Create a new Sequence Diagram
- The easiest way is to select the "New Sequence Diagram" pop-up menu item,
under the wanted context (a package or a use case). Intermediate UML elements (Collaboration and Interaction) are automatically added in the browser and a new view-window appears.
- An alternative way consists in creating manually the UML elements:
- create a new Collaboration under its context using "New
Collaboration" pop-up menu item.
- then create a new Interaction "New Interaction" under this Collaboration
- and then click on the pop-up menu item "Draw as scenario" of this Interaction.
Sequence Diagram Graphical Elements
With the pop-up menu on a SD view-window, you can draw the following
diagram elements:
- ClassifierRole
Its representation is a box with a line (calls
lifeline). The lifeline displays with a default height, you can lengthen or shorten it by
moving vertically the bottom of the line.
You can also select and move
horizontally the ClassifierRole.
The naming is conform to the UML syntax: "/RoleName: BaseClassName".
- Message
It is represented by an arrow with a different aspect according to its type.
Several types are available:
- Simple: a solid line with a stick arrowhead, without associated action.
- Creation: a solid line with a filled solid arrowhead pointing toward
the created ClassifierRole, with an associated method of creation (by default "new()").
- Destruction: a simple message pointing toward a cross marker, with
an associated method of destruction (by default "destroy()").
- Return: a dashed line with a stick arrowhead, with an associated
clause of return (by default "return").
- Call: a simple message calling an operation. (not yet fully available)
When you add a new message on the diagram, by default, it is a simple
message. To easily change message's type, you can select the message, then right-click,
choose the pop-up menu item "Transform into..." and then the wanted type among
"Creation", "Destruction", "Return" and
"Uninterpreted" (the equivalent of a simple message but associated to a
new uninterpreted action). An other way is to update directly its type
thanks to the Message and Action editors (see section about editors).
You can select a message and move it vertically. When it is a creation
message, the created classifier moves with it.
Messages are labelled with the following syntax: "MessageName: ActionScript".
Note : Things you can't do yet:
- You can't draw explicitly focus of controls (i.e. periods of time during
which an object is active, performing an action).
- No explicit representation for asynchronous message (usually represented
with a half stick arrowhead).
- SD do not well support message to self.
-
The following example is taken out of The Unified Modeling Language Reference Manual by James Rumbaugh, Ivar Jacobson, Grady Booch. Here is the sequence diagram realized with UMLAUT:
ClassifierRole, Message and Action editors
In the UMLAUT browser, the ClassifierRoles appear under a Collaboration. You can add new ClassifierRoles under Collaboration, with the function "New ClassifierRole" of the collaboration pop-up menu. You can edit a ClassifierRole with the "Edit" command, and complete its features thanks to an editor.
The Messages appear under an Interaction. They make a tree, the Interaction is the root node.
You can add a new Message:
- connecting it to the Interaction, by using the "New Message" item of the interaction pop-up. In this case, it will be created without activator, nor predecessor, directly under the interaction.
- adding it as a new message activated by an existing message (i.e the activator), by using the "Activate a new message" item of the activator pop-up menu. It will appear as a new node under its activator.
- adding it as a successor of an existing message (i.e. its predecessor), by using the "Add a successor message" item of the predecessor pop-up menu. It will appear as a new node under its predecessor.
You can edit and modify its features (Name, Activator, Predecessors, Successors, Sender, Receiver...) thanks to the following editor.
In particular, you can associate a new action, either with drag&drop (dropping an existing Action to the Action TextField), or clicking on the "New" button.
In this last case, the new Action is created in the browser under the top-level package, and the following Action editor opens.
Generating the SD view from an interaction
Use the "Draw as scenario" command to generate automatically the view of an interaction. It is based on a simple algorithm to draw messages following the order introduced by the activator/predecessor/successor features.