Sequence diagram
   HOME

TheInfoList



OR:

A sequence diagram or system sequence diagram (SSD) shows process interactions arranged in time sequence in the field of
software engineering Software engineering is a systematic engineering approach to software development. A software engineer is a person who applies the principles of software engineering to design, develop, maintain, test, and evaluate computer software. The term '' ...
. It depicts the processes involved and the sequence of messages exchanged between the processes needed to carry out the functionality. Sequence diagrams are typically associated with use case realizations in the
4+1 architectural view model 4+1 is a view model used for "describing the architecture of software-intensive systems, based on the use of multiple, concurrent views".Kruchten, Philippe (1995, November)Architectural Blueprints — The “4+1” View Model of Software Architect ...
of the system under development. Sequence diagrams are sometimes called event diagrams or event scenarios. For a particular scenario of a
use case In software and systems engineering, the phrase use case is a polyseme with two senses: # A usage scenario for a piece of software; often used in the plural to suggest situations where a piece of software may be useful. # A potential scenario ...
, the diagrams show the events that external actors generate, their order, and possible inter-system events. All
systems A system is a group of interacting or interrelated elements that act according to a set of rules to form a unified whole. A system, surrounded and influenced by its environment, is described by its boundaries, structure and purpose and expresse ...
are treated as a black box; the diagram places emphasis on 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 In software and systems engineering, the phrase use case is a polyseme with two senses: # A usage scenario for a piece of software; often used in the plural to suggest situations where a piece of software may be useful. # A potential scenario ...
, and frequent or complex alternative scenarios.


Key elements of sequence diagram

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 the specification of simple runtime scenarios in a graphical manner. 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 software and systems engineering, the phrase use case is a polyseme with two senses: # A usage scenario for a piece of software; often used in the plural to suggest situations where a piece of software may be useful. # A potential scenario ...
in a visual format. In order to construct a system sequence diagram, you need to be familiar with the
unified modeling language The Unified Modeling Language (UML) is a general-purpose, developmental modeling language in the field of software engineering that is intended to provide a standard way to visualize the design of a system. The creation of UML was originally m ...
(UML). 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. When an action line is connected to a lifeline it 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, the actor could request to log in, this would be represented by login (username, password). After each action is performed, the response or next action is located under the previous one. As you read down the lines you will 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 represen
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 doesn’t have to wait for a response. Asynchronous calls are present in multithreaded applications, event-driven applications and in
message-oriented middleware Message-oriented middleware (MOM) is software or hardware infrastructure supporting sending and receiving messages between distributed systems. MOM allows application modules to be distributed over heterogeneous platforms and reduces the comple ...
. Activation boxes, or
method Method ( grc, μέθοδος, methodos) literally means a pursuit of knowledge, investigation, mode of prosecuting such inquiry, or system. In recent centuries it more often means a prescribed process for completing a task. It may refer to: *Scien ...
-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 Processing is a free graphical library and integrated development environment (IDE) built for the electronic arts, new media art, and visual design communities with the purpose of teaching non-programmers the fundamentals of computer programming ...
. If an object is destroyed (removed from
memory Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remember ...
), an X is drawn on bottom of 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'',OMG (2007)
OMG Unified Modeling Language (OMG UML), Superstructure, V2.1.2
p. 467.
which are then used to model interactions that include parallelism, conditional branches, optional interactions.


See also

* Message sequence chart


References


External links


Current UML Specification
by Object Management Group (OMG)
Introduction to UML 2 Sequence Diagrams
by Scott W. Ambler.
A Quick Introduction to UML Sequence Diagrams
by Yanic Inghelbrecht

{{DEFAULTSORT:Sequence Diagram Unified Modeling Language diagrams Systems engineering