UML-sequence diagram

Source: Internet
Author: User
Document directory
  • 1) Call: the sender of the message sends the request to the receiver of the message, requesting the recipient object to perform some operation. Normally, this requires sending
  • 2) asynchronous: In this message, the sender transfers the control to the receiver, but does not wait until the operation is completed.
I. Description of the sequence diagram

The sequence disequence describes the time sequence of messages transmitted between objects. It is used to represent the behavior sequence in the use case and an interactive diagram that emphasizes the time sequence of messages.

A sequence diagram describes the interaction between classes in a class system. It models these interactions as message exchanges. When a use case is executed, each message in the sequence diagram corresponds to a trigger event that triggers conversions in a class operation or state machine.

Objects participating in interaction are arranged at the top of the sequence chart. A vertical dotted line is drawn at the bottom of each object. When an object sends a message to another object, this message begins with the dotted line at the bottom of the sending object and ends with the dotted line at the bottom of the receiving object. These messages are displayed by arrows and placed horizontally in vertical directions, the sooner a message is sent, the closer it is to the top. When an object receives a message, it uses the message as a command to execute an action. Therefore, the time sequence diagram provides you with clear and visualized tracks of the event stream over time.

Ii. elements contained in the sequence diagram (1) Objects

An object represents the role of an object in the sequence diagram in interaction. Objects are arranged from left to right on the top of the ordinal graph.

(2) messages

Messages from one object to another are represented by message lines spanning the object lifeline. The object can also send messages to itself, that is,

The message line starts from its own lifeline and returns to its own lifeline.

Message Type:

1) Call: the sender of the message sends the request to the receiver of the message, requesting the recipient object to perform some operation. Normally, this requires sending

The sender waits for the receiver to return the message, so this message is also called a synchronous message.

 

2) asynchronous: In this message, the sender transfers the control to the receiver, but does not wait until the operation is completed.

 

(3) lifeline

The lifeline represents the existence of objects in the sequence chart for a period of time. The center at the bottom of each object has a vertical dotted line, which is the object's

Lifeline. messages between objects exist between two dotted lines.

Basic Map operator set of the sequence chart:

Iii. Purpose of the time sequence diagram (1) the time sequence diagram has a lifeline

The lifeline indicates the existence of an object over a period of time. It is precisely because of this feature that the time sequence graph is suitable for the time sequence of messages between objects.

Generally, the lifeline of an object is drawn from the top to the bottom of the graph. This indicates that the object exists throughout the interaction process, but the object can also be created in the whole interaction process.

Construction and revocation,

(2) The sequence chart has an activation period.

The activation period indicates the time when an object executes an action directly or indirectly. The height of the activation rectangle indicates the activation duration. The Time Sequence Graph

It visually describes the time when an object executes an operation. Obviously, this feature makes object interaction between systems easier to understand.

Iv. Sequence Chart Modeling Technology

When modeling a sequence chart, follow the following policies:

(1) set the interaction context. These contexts can be a script for systems, subsystems, operations, classes, use cases, and collaboration.

(2) identify the role of an object in interaction and place the object from left to right in the sequence diagram based on its importance.

(3) set the lifeline of each object. Generally, a formation occurs throughout the interaction process, but it can be created and revoked during the interaction process.

(4) Draw the subsequent messages between the lifeline from top to bottom from the information that triggers an interaction.

(5) set the object activation period, which can visualize the time point when the actual computing occurs and the nesting of visual messages.

(6) If you need to set post-time space constraints, you can attach appropriate time and control constraints to each message.

(7) Attach the front or back conditions to each message of a control flow, which can describe the control flow in more detail.

V. Example of Time Sequence diagram modeling (1) Ideal scenario modeling of "Buy a beverage" on the beverage sales machine

(2) Modeling with incorrect change quantity

 

(3) Computer Room charging system for students

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.