UML-sequence diagram

Source: Internet
Author: User

I. Purpose

For a development team, the sequence diagram is very important because it is used to describe the interaction between a group of objects in the system, especially for crawlers.

The project and sequence diagram of business complexity allow us to clarify these complex processes more quickly.

 

Ii. Basic Elements

The UML elements in the sequence diagram are still relatively small. We need to cut a diagram first.

1: lifeline

First, we need to know that a sequence chart has a combination of dynamic and static characteristics. It uses a class chart as a static structure and an example chart as a dynamic behavior process. So we can consider the lifeline

It is a class, for example, "Customer: customer". The former is an instance of the class, the latter is the class name, and the "X" in the figure is the class destructor, that is, destruction.

Note that the "Actor" attribute in the figure is set to true, and the Lifeline will become the lifeline of the participant.

2: synchronous and asynchronous

Speaking of synchronization or Asynchronization, I think the first response may be Ajax or thread. Since the sequence diagram is an illustration of the interaction between objects, synchronization is inevitable.

Or asynchronous. In UML elements, "synchronization" has a forward and backward arrow, while "Asynchronous" is a one-way arrow.

From the above sequence diagram, we can see that the customer places an order to order. After the order is placed successfully, an asynchronous request email is sent at the same time. Since the order is asynchronous

The main process is affected.

3: Create

If you want to create other lifeline (Class Object) in the interaction segment, you need to create a message at this time. However, in actual application, there is still less to be used. After all, everything works.

Everything follows the principle.

In vs2010, there is a "reverse engineering" that supports sequence diagrams, which is quite interesting. Let's take a look at it first. I instantiated a test class in program to see how it

Whether to use create in the figure.

 

4: Combined fragments

Now we know that a group of objects are interacting in a sequence diagram, so there must be logic for interaction, such as if/else, for, and so on. In UML, there are such businesses as 12.

The combination of logical fragments, the same as the principle, can be used to understand some common.

By comparing the two diagrams, I think you must understand the meaning of the sequence diagram below.

 

Finally, with the summary above, I think you can understand this picture as well.

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.