ArticleslgStudy

engineering

Sequence diagram

Sequence diagram is a engineering topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Sequence diagram rather than just read about it. In short: In software engineering, a sequence diagram shows process interactions arranged in time sequence. This diagram depicts the processes and objects involved and the sequence of messages exchanged as needed to carry out the functionality.

Sequence diagram — main illustration
Sequence diagram — illustration

Key takeaways

  • Sequence diagram belongs to engineering; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Sequence diagram to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Sequence diagram from memory before moving on to harder problems.

Reference excerpt

In software engineering, a sequence diagram shows process interactions arranged in time sequence. This diagram depicts the processes and objects involved and the sequence of messages exchanged as needed to carry out the functionality. Sequence diagrams are typically associated with use case realizations in the 4+1 architectural view model of the system under development. Sequence diagrams are sometimes called event diagrams or event scenarios. For a particular scenario of a use case, the diagrams show the events that external actors generate, their order, and possible inter-system events. The diagram emphasizes events that cross the system boundary from actors to systems. A system sequence diagram should be done for the main success scenario of the use case, and frequent or complex alternative scenarios. There are two kinds of sequence diagrams:

Sequence Diagram (SD): A regular version of sequence diagram describes how the system operates, and every object within a system is described specifically. System Sequence Diagram (SSD): All systems are treated as a black box, where all classes owned by the system are not depicted. Instead, only an object named System is depicted.

Key elements of sequence diagrams A sequence diagram shows, as parallel vertical lines (lifelines), different processes or objects that live simultaneously, and, as horizontal arrows, the messages exchanged between them in the order in which they occur. This allows for the graphical specification of simple runtime scenarios. A system sequence diagram should specify and show the following:

External actors Messages (methods) invoked by these actors Return values (if any) associated with previous messages Indication of any loops or iteration area

Reading a system sequence diagram Professionals, in developing a project, often use system sequence diagrams to illustrate how certain tasks are done between users and the system. These tasks may include repetitive, simple, or complex tasks. The purpose is to illustrate the use case in a visual format. Familiarity with unified modeling language (UML) is needed to construct a system sequence diagram. These models show the logic behind the actors (people who affect the system) and the system in performing the task. Reading a sequence diagram begins at the top with the actor(s) or the system(s) (which is located at the top of the page). Under each actor or system there are long dotted lines, called "lifelines", which are attached to them. Actions are performed with lines that extend between these lifelines. The connection between an action line and a lifeline shows the interaction between the actor or system. Messages will often appear at the top or bottom of a system sequence diagram to illustrate the action in detail. For example, a request by an actor to log in would be represented by login (username, password). After each action is performed, the response or next action is located under the previous one. By reading down the lines, one can see in detail how certain actions are performed in the provided model, and in what order.

Diagram building blocks If the lifeline is that of an object, it demonstrates a role. Leaving the instance name blank can represent anonymous and unnamed instances. → Messages, written with horizontal arrows with the message name written above them, display interaction. Solid arrow heads represent synchronous calls, open arrow heads represent asynchronous messages, and dashed lines represent reply messages. If a caller sends a synchronous message, it must wait until the message is done, such as invoking a subroutine. If a caller sends an asynchronous message, it can continue processing and need not wait for a response. Asynchronous calls are present in multithreaded applications, event-driven applications, and in message-oriented middleware. Activation boxes, or method-call boxes, are opaque rectangles drawn on top of lifelines to represent that processes are being performed in response to the message (ExecutionSpecifications in UML). Objects calling methods on themselves use messages and add new activation boxes on top of any others to indicate a further level of processing. If an object is destroyed (removed from memory), an X is drawn below the lifeline, and the dashed line ceases to be drawn below it. It should be the result of a message, either from the object itself, or another. A message sent from outside the diagram can be represented by a message originating from a filled-in circle (found message in UML) or from a border of the sequence diagram (gate in UML). UML has introduced significant improvements to the capabilities of sequence diagrams. Most of these improvements are based on the idea of interaction fragments which represent smaller pieces of an enclosing interaction. Multiple interaction fragments are combined to create a variety of combined fragments, which are then used to model interactions that include parallelism, conditional branches, and optional interactions.

See also Message sequence chart

References

External links

"About the Unified Modeling Language Specification Version 2.5.1". Object Management Group Standards Development Organization (OMG SDO). December 2017. Introduction to UML 2 Sequence Diagrams by Scott W. Ambler. A Quick Introduction to UML Sequence Diagrams Archived 2010-01-11 at the Wayback Machine by Yanic Inghelbrecht UML 2 Sequence Diagrams

Illustrations

Sequence diagram: The Sequence diagram of UML
The Sequence diagram of UML
Sequence diagram: Overview
Overview

Worked examples

Example 1 — a first encounter with Sequence diagram

Start with the simplest possible case. Write down what Sequence diagram claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In engineering, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Sequence diagram before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Sequence diagram ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Sequence diagram

In research
Sequence diagram appears in engineering research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Sequence diagram in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Sequence diagram is common in secondary-school and first-year university syllabi. It links to neighbouring topics Systems engineering, Unified Modeling Language diagrams, so understanding it makes those chapters shorter.
In everyday life
Look for Sequence diagram outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Sequence diagram” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Sequence diagram in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Sequence diagram means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Sequence diagram out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Sequence diagram in simple terms?

In software engineering, a sequence diagram shows process interactions arranged in time sequence. This diagram depicts the processes and objects involved and the sequence of messages exchanged as needed to carry out the functionality.

Why does Sequence diagram matter?

Because it connects several engineering ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Sequence diagram?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Sequence diagram.

Tags

  • Systems engineering
  • Unified Modeling Language diagrams

Keep exploring