Sequence Diagram

Key elements

Notions and their significance

All other observations that makes the UML

Sequence diagrams are a type of UML diagram that show how objects in a system or classes within code interact with each other

Particularly these diagrams show interactions in order they take place in other words, they show the sequence of events.

click to edit

If diagramming a system, that would mean all the parts of that system.

If diagramming code, that would mean all of the classes that make up the program.

Objects

Parts involved in the system

Actor

Actors are always outside the scope of the system in a sequence diagram

Actor

Actors are represented by stick figures

Objects

Are represented by rectangles

Objects to be placed in sequential order from left to right

Lifelines

Lifelines are the vertical dashed lines that show the existence of an object or actor over time

Moving down the Lifeline means that more time is passing.

Interaction between actor and objects

Message

Show the information being sent between objects sequence diagrams show the order of interactions or Sequences, and they do this by moving down the lifeline with each message

Return or reply message

Message

Always represented by a dashed line

Return lines often move from right to left

That isn't always the case

The dashed line represents a return message or a message from the receiving object back to the requesting object

A message from the receiving object back to the requesting object

Alternative frame

Symbolizes a choice between two or more message sequences

Activation boxes

Activation boxes show when and how long an object is performing a process


This shows at a glance when objects are active and when they are idle

Actors are external objects. They don't need an activation box

Fairly simple sequence diagrams can get even more complex

Diagramming code

The objects might be labeled as the names of classes, and the messages might be the methods and functions used in the code

Sequence Diagram