Article Consultation Solution Tool Course Member  
 
 
 
     
   
 Subscribe
UML Diagram: Sequence Diagram
 
Zu Tao ,Pitaya System Engineering
Views    2020-2-21
 

 

Why do you need sequence diagram modeling

We generally describe the process in 2 ways:

1. Arrange the activities in chronological order, which is the activity diagram. SeeActivity diagram.

2. List the objects and describe the interaction of each object in chronological order, which is the interaction diagram.

Sequence diagrams are a type of interaction diagram (in addition, there are communication diagrams, interaction overview diagrams, and time diagrams, see:(UML overview).To describe the process of an activity, people generally think of an activity diagram, so why do we need a sequence diagram?

This is because it is impossible to describe the process without knowing who is responsible for the various activities of the process. Therefore, the process must be broken down into responsibilities for multiple roles/classes/modules. The relationship and responsibilities of classes are described in a class diagram (see:Class diagram), while an activity diagram and a class diagram are completely different perspectives, which requires a diagram that depicts the activity process from the perspective of object interaction.

Take a look at the comparison of the two legends below:

 

Here's an analytical design approach that introduces sequence diagrams:

 

It can be seen that with the help of sequence diagrams, we can clearly decompose activities into object interactions, and then define class diagrams, so that each behavior has a responsible person, which is a key part of both business process analysis and software process analysis:

  • Interaction analysis of business processes allows for someone to take responsibility for each business effort.
  • Interaction analysis of software processes allows each software function to be held accountable by modules.

What is there in the sequence diagram

Any UML diagram has semantics, elements, relationships, and purposes, and the following is a list of sequential diagrams:

Semanteme Describes the chronological interaction of several objects
Element object (object), lifeline, endpoint, diagram gate), state
Relationship Messages between objects are divided into synchronous calls, asynchronous messages, and self messages message)
Use You can describe the interaction between business objects, the interaction between users and the system, or you can describe the interaction between system objects.

 

Legend: Sequence diagram of the snake game

In order to make the reader see more vividly, the usage of the sequence diagram is introduced in the form of a legend, and the following is the sequence diagram of the snake game:


Sequence Diagram Description:

  • Object interaction rather than class interaction, because objects can exist in time and have life.
  • Arrange the order of messages according to the upper and lower positions in time
  • The interaction process of sequence diagrams is irreversible because time passes and history cannot be repeated.

 

Description of the object:

  • Objects generally belong to a certain class, and there can be multiple objects of the same kind on a sequence diagram.
  • It's a good idea for an object to have a name so that we can distinguish between multiple objects of the same kind.
  • The process of assigning responsibilities to the interaction of objects is the process of assigning responsibilities, which creates the responsibilities of the class (see: class diagram);
  • The principle of responsibility distribution is: high cohesion, low coupling, such a relationship is simple and clear, little mutual influence, and high execution efficiency.

 

Description of the message:

The message must be sent or received by the object, so the message also has a long existence;
Messages can't extend beyond the lifecycle of an object.
There are 3 types of interactive messages:
  • Synchronize messages: The object that sent the message waits for the response of the object receiving the message, and then proceeds to Next after the response is available.
  • Asynchronous message: The object that sends the message continues to do its own thing after sending the message, without waiting for the response of the object receiving the message.
  • Self Message: A message sent by the subject to himself/herself, that is, to perform his or her own duties.

 

Description of the elements of the sequence diagram:

The following is a description dictionary of the objects in the sequence diagram:

Serial number Object  Illustrate
 1.  player1:Player The object of the game, you can start the game and control the direction of the snake.
 2.  Timer1:Timer Timer objects that can generate a clock heartbeat that drives the snake to crawl.
 3.  map1:Map
The map object, which can be opened, has a food object and a snake object on it.
 4.  snake1:Snake The object of the snake, created by the map, can crawl and can also eat food.
 5.  Food1:Food Food objects, which can be created by maps or eaten by snakes.

Note: The model in this paper is modeled by the modeling tool EA.

 

 


UML Diagram Series:

1.UML Overview
2.Use Case Diagram
3.Activity Diagram
4.Class Diagram
5.Object Diagram
6.Sequence Diagram
7.Interpretation of the Mapping Relationship between Class Diagram and Code (C++)

 

Postscript

I hope you have benefited from reading this.

If you are willing to share your experience, please submit it to us.

If you are interested in our training, consulting and tools:

  • Course: Analytical design based on UML and EA  
  • Course: MBSE (Model-Based Systems Engineering)  
  • Course: Model-Based Requirements Management) Methods and Practices
  • Course: System Design and Modeling Based on SysML and EA
  • Course: Enterprise Architecture Modeling
  • Course: System Architecture Modeling Methods and Cases
  • Course: Domain-Driven Modeling and Design
  • Course: Model-Based Design
  • Course: Business Modeling and Business Analysis
  • Modeling tool: EA
  • Model-based requirements management tool: iSpace
  • Consulting Solution: MBSE (Model-Based Systems Engineering)
  • Consulting Solution: Model-Driven Development Based on UML
  • Welcome to contact us: umlooo@hotmail.com

       
    Views  
     
    Related Articles

    UML Overview
    UML Diagram: Use Case Diagram
    UML Diagram: Activity Diagram
    UML diagram: class diagram
    UML Diagram: Object Diagram
    UML Diagram: sequence diagram
     
    Related Courses

    MBSE (Model-based Systems Engineering)
    System analysis and design based on UML
    Business Modeling & Business Analysis
    System design and modeling SysML EA
    Model-based requirements management
    Business Modeling &; Domain-Driven
     
    Related Tool

    MBSE Platform
    Modeling Tools EA
    Requirements Management
    Automatic modeling
    Multi-level simulation -Sys Simulator
    Code Engineer

    Tool News
    June 2024 EA v17.0 Beta release
    November 2022 EA v16.1 release notes
    November 2022 EA v16.1 official release
    July 2022 EA v16.05 release notes
    April 2022 EA16.0 official release
     
    Latest Article
    UML Overview
    UML Diagram: Use Case Diagram
    UML Diagram: Activity Diagram
    UML diagram: class diagram
    UML Diagram: Object Diagram
    UML Diagram: sequence diagram
    Specification changes from UML 2.4 to UML 2.5
    DDS models and modeling tools
    More...   
    MBSE Tool
    MBSE Platform
    Modeling Tools EA
    Requirements Management
    Automatic modeling
    Multi-level simulation -Sys Simulator
    Code Engineer
    DocGenerator
    Model Checker
    R&D management
    TestDriver
    Model Based Quality Manager (inspector)
    More...   
    Successful Case
    Gac Research Institute SysML+EA+ Software
    Modeling tools EA, WebEA, and learning
    China Automotive Intelligence modeling tools EA...
    Ekatong MBSE tool chain consulting
    Avic UAV MBSE tool chain
    Geely Auto buys EA tools
    Huaco Auto parts buy EA tools
    Dongfeng LAN Map Auto purchase EA tools