2/1/2022

Purpose Of System Sequence Diagram

Benefits of using UML sequence diagrams

These are some of the main benefits of using UML sequence diagrams.

Purpose of Sequence Diagram Model high-level interaction between active objects in a system Model the interaction between object instances within a collaboration that realizes a use case Model the interaction between objects within a collaboration that realizes an operation. Purpose of Sequence Diagram Model high-level interaction between active objects in a system Model the interaction between object instances within a collaboration that realizes a use case Model the interaction between objects within a collaboration that realizes an operation. A sequence diagram is a type of interaction diagram because it describes how—and in what order—a group of objects works together. These diagrams are used by software developers and business professionals to understand requirements for a new system or to document an existing process. What is Sequence Diagram? A sequence diagram simply depicts interaction between objects in a sequential order i.e. The order in which these interactions take place. We can also use the terms event diagrams or event scenarios to refer to a sequence diagram. Sequence diagrams describe how and in what order the objects in a system function. 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.


1.Help you discover architectural, interface and logic problems early. Because they allow youto flesh out details before having to implement anything, sequence diagrams are useful tools to find architectural, interface and logic problems early on in the design process. You can validate your architecture, interfaces, state machine and logic by seeing how the system architecture would handle different basic scenarios and special cases.

This is particularly true for systems involving the interaction of components that are being implemented in parallel by different teams. In the cell phone example, each task would typically be implemented by a separate team. Having a set of sequence diagrams describing how the interfaces are actually used and what messages/actions are expected at different times gives each team a consistent and robust implementation plan. You can also document how special cases should be handled across the entire system. The very act of creating the sequence diagrams and making them work with your architecture is valuable because it forces you to think about details such as interfaces, states, message order, assignment of responsibilities, timers/timeouts and special/error cases ahead of time.

Management

2.Collaboration tool. Sequence diagrams are valuable collaboration tools during design meetingsbecause they allow you to discuss the design in concrete terms. You can see the interactions between entities, various proposed state transitions and alternate courses/special cases on paper as you discuss the design. In our experience, having a concrete design proposal during design meetings greatly enhances the productivity of these meetings even if the proposed design has problems. You can narrow down the problems and then make corrections to solve them. The proposal serves as a concrete starting point for the discussion and as a place to capture proposed changes. Sequence diagram editor makes it so easy to edit your sequence diagrams that you could even make the corrections in real time during the meeting and instantly see the result of the changes as you make them.

3.Documentation. Sequence diagrams can be used to document the dynamic view of the systemdesign at various levels of abstraction, which is often difficult to extract from static diagrams or even the complete source code. The diagrams can abstract much of the implementation detail and provide a high level view of system behavior. Below is a sequence diagram for making a hotel reservation. The object initiating the sequence of messages is a Reservation window.


The Reservation window sends a makeReservation() message to a HotelChain. The HotelChain then sends a makeReservation() message to a Hotel. If the Hotel has availablerooms, then it makes a Reservation and a Confirmation.

Purpose Of System Sequence Diagram Pdf

Each vertical dotted line is a lifeline, representing the time that an object exists. Each arrow is a message call. An arrow goes from the sender to the top of the activation bar of the message on the receiver's lifeline. The activation bar represents the duration of execution of the message.

In our diagram, the Hotel issues a self call to determine if a room is available. If so, then the Hotel creates a Reservation and a Confirmation. The asterisk on the self call means iteration (to make sure there is available room for each day of the stay in the hotel). Theexpression in square brackets, [ ], is a condition.


The sequence diagram represents the flow of messages in the system and is also termed as an event diagram. It helps in envisioning several dynamic scenarios. It portrays the communication between any two lifelines as a time-ordered sequence of events, such that these lifelines took part at the run time. In UML, the lifeline is represented by a vertical bar, whereas the message flow is represented by a vertical dotted line that extends across the bottom of the page. It incorporates the iterations as well as branching.

Purpose of a Sequence Diagram

Purpose Of System Sequence Diagram

System sequence diagram example
  1. To model high-level interaction among active objects within a system.
  2. To model interaction among objects inside a collaboration realizing a use case.
  3. It either models generic interactions or some certain instances of interaction.

Notations of a Sequence Diagram

Lifeline

An individual participant in the sequence diagram is represented by a lifeline. It is positioned at the top of the diagram.

Actor

A role played by an entity that interacts with the subject is called as an actor. It is out of the scope of the system. It represents the role, which involves human users and external hardware or subjects. An actor may or may not represent a physical entity, but it purely depicts the role of an entity. Several distinct roles can be played by an actor or vice versa.

Activation

It is represented by a thin rectangle on the lifeline. It describes that time period in which an operation is performed by an element, such that the top and the bottom of the rectangle is associated with the initiation and the completion time, each respectively.

Messages

The messages depict the interaction between the objects and are represented by arrows. They are in the sequential order on the lifeline. The core of the sequence diagram is formed by messages and lifelines.

Purpose

Following are types of messages enlisted below:

Library system sequence diagram
  • Call Message: It defines a particular communication between the lifelines of an interaction, which represents that the target lifeline has invoked an operation.
  • Return Message: It defines a particular communication between the lifelines of interaction that represent the flow of information from the receiver of the corresponding caller message.
  • Self Message: It describes a communication, particularly between the lifelines of an interaction that represents a message of the same lifeline, has been invoked.
  • Recursive Message: A self message sent for recursive purpose is called a recursive message. In other words, it can be said that the recursive message is a special case of the self message as it represents the recursive calls.
  • Create Message: It describes a communication, particularly between the lifelines of an interaction describing that the target (lifeline) has been instantiated.
  • Destroy Message: It describes a communication, particularly between the lifelines of an interaction that depicts a request to destroy the lifecycle of the target.
  • Duration Message: It describes a communication particularly between the lifelines of an interaction, which portrays the time passage of the message while modeling a system.

Note

A note is the capability of attaching several remarks to the element. It basically carries useful information for the modelers.

Sequence Fragments

  1. Sequence fragments have been introduced by UML 2.0, which makes it quite easy for the creation and maintenance of an accurate sequence diagram.
  2. It is represented by a box called a combined fragment, encloses a part of interaction inside a sequence diagram.
  3. The type of fragment is shown by a fragment operator.

Types of fragments

Following are the types of fragments enlisted below;

OperatorFragment Type
altAlternative multiple fragments: The only fragment for which the condition is true, will execute.
optOptional: If the supplied condition is true, only then the fragments will execute. It is similar to alt with only one trace.
parParallel: Parallel executes fragments.
loopLoop: Fragments are run multiple times, and the basis of interaction is shown by the guard.
regionCritical region: Only one thread can execute a fragment at once.
negNegative: A worthless communication is shown by the fragment.
refReference: An interaction portrayed in another diagram. In this, a frame is drawn so as to cover the lifelines involved in the communication. The parameter and return value can be explained.
sdSequence Diagram: It is used to surround the whole sequence diagram.

Example of a Sequence Diagram

An example of a high-level sequence diagram for online bookshop is given below.

Any online customer can search for a book catalog, view a description of a particular book, add a book to its shopping cart, and do checkout.

Purpose

Benefits of a Sequence Diagram

  1. It explores the real-time application.
  2. It depicts the message flow between the different objects.
  3. It has easy maintenance.
  4. It is easy to generate.
  5. Implement both forward and reverse engineering.
  6. It can easily update as per the new change in the system.

What Is System Sequence Diagram

The drawback of a Sequence Diagram

  1. In the case of too many lifelines, the sequence diagram can get more complex.
  2. The incorrect result may be produced, if the order of the flow of messages changes.
  3. Since each sequence needs distinct notations for its representation, it may make the diagram more complex.
  4. The type of sequence is decided by the type of message.
Next TopicUML Collaboration Diagram

What Is Sequence Diagram