UML Sequence Diagrams: Reference


For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see UML Sequence Diagrams: Reference on In Visual Studio, 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. Use sequence diagrams to visualize instances and events, instead of classes and methods. More than one instance of the same type can appear on the diagram. More than one occurrence of the same message can also appear.

UML sequence diagrams are part of a UML model and exist only within UML modeling projects. To create a UML sequence diagram, on the Architecture menu, click New UML or Layer Diagram. Find out more about how to create and draw UML sequence diagrams or UML modeling diagrams in general.

To see which versions of Visual Studio support this feature, see Version support for architecture and modeling tools.

The following table describes the elements that you can see on a sequence diagram. Find out more about these elements' properties.

Parts of a sequence diagram

1LifelineA 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.
2ActorA 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.
3Synchronous messageThe 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.
4Asynchronous messageA 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.
5Execution occurrenceA 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.
6Callback messageA 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.
7Self messageA message from a participant to itself. The resulting execution occurrence appears on top of the sending execution.
8Create messageA message that creates a participant. If a participant receives a create message, it should be the first it receives.
9Found messageAn asynchronous message from an unknown or an unspecified participant.
10Lost messageAn asynchronous message to an unknown or an unspecified participant.
11CommentA comment can be attached to any point on a lifeline.
12Interaction UseEncloses 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.
13Combined FragmentA collection of fragments. Each fragment can enclose one or more messages. There are different kinds of combined fragments. For more information, see Describe control flow with fragments on UML sequence diagrams.

To create a fragment, right-click a message, point to Surround With, and then click a fragment type.
14Fragment GuardCan 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.
XDestruction EventRepresents the point at which the object is deleted or no longer accessible. Appears at the bottom of every lifeline.
InteractionThe 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.
Sequence DiagramThe diagram that displays an Interaction. To view its properties, click on an empty part of the diagram. Note: The names of the Sequence Diagram, the Interaction that it displays, and the file that contains the diagram can all be different.

UML Sequence Diagrams: Guidelines
Edit UML models and diagrams
UML Use Case Diagrams: Reference
UML Class Diagrams: Reference
UML Component Diagrams: Reference
UML Component Diagrams: Reference