UML Sequence Diagrams: Reference
Updated: August 2011
In Visual Studio Ultimate, a sequence diagram shows an interaction, which represents the sequence of messages between instances of classes, components, subsystems, or actors. Time flows down the diagram, and it shows the flow of control from one participant to another. To create a UML sequence diagram, on the Architecture menu, click New Diagram.
The diagram shows example instances and events, instead of classes and methods; more than one instance of the same type can appear in the diagram, and more than one occurrence of the same message can appear also.
There are two kinds of sequence diagram:
Code-based Sequence Diagrams can be generated from .NET program code, and can be placed within any project. For more information, see How to: Explore Code with Sequence Diagrams.
UML Sequence Diagrams form part of a UML model, and exist only within UML modeling projects. For more information, see UML Sequence Diagrams: Guidelines.
The two kinds of sequence diagram are similar, although a few of the properties of the elements are different.
For more information about how to create and draw modeling diagrams, see How to: Edit a UML Model and Diagrams.
The following table describes the elements that you can see on a sequence diagram. For information about the properties of these elements, see Properties of Elements in UML Sequence Diagrams.
For a information about how to use sequence diagrams, see UML Sequence Diagrams: Guidelines.
A vertical line that represents the sequence of events that occur in a participant during an interaction, while time progresses down the line. This participant can be an instance of a class, component, or actor.
A participant that is external to the system that you are developing.
You can make an actor symbol appear at the top of a lifeline by setting its Actor property.
The sender waits for a response to a synchronous message before it continues. The diagram shows both the call and the return. Synchronous messages are used to represent ordinary function calls within a program, as well as other kinds of message that behave in the same way.
A message that does not require a response before the sender continues. An asynchronous message shows only a call from the sender. Use to represent communication between separate threads or the creation of a new thread.
A vertical shaded rectangle that appears on a participant's lifeline and represents the period when the participant is executing an operation.
The execution begins where the participant receives a message. If the initiating message was a synchronous message, the execution ends with a «return» arrow back to the sender.
A message that returns back to a participant that is waiting for the return from an earlier call. The resulting execution occurrence appears on top of the existing one.
A message from a participant to itself. The resulting execution occurrence appears on top of the sending execution.
A message that creates a participant. If a participant receives a create message, it should be the first it receives.
An asynchronous message from an unknown or an unspecified participant.
An asynchronous message to an unknown or an unspecified participant.
A comment can be attached to any point on a lifeline.
Encloses a sequence of messages that are defined in another diagram.
To create an Interaction Use, click the tool and then drag across the lifelines you want to include.
A collection of fragments. Each fragment can enclose one or more messages. There are different kinds of combined fragments. For more information, see Describing Control Flow with Fragments in UML Sequence Diagrams.
To create a fragment, right-click a message, point to Surround With, and then click a fragment type.
Can be used to state a condition relevant to whether the fragment will occur.
To set the guard, select a fragment, then select the guard, and type a value.
Represents the point at which the object is deleted or no longer accessible. Appears at the bottom of every lifeline.
The collection of messages and lifelines that is displayed in the sequence diagram. To view the properties of an Interaction, you must select it in UML Model Explorer.
The diagram that displays an Interaction. To view its properties, click on an empty part of the diagram.
The names of the Sequence Diagram, the Interaction that it displays, and the file that contains the diagram can all be different.