Nine types of diagrams and drawing techniques in UML-sequence diagram and collaboration Diagram

Source: Internet
Author: User

Various diagrams in UML are an important part of the UML model. In recent articles, I will introduce nine important diagrams in UML. The general content is shown in the following directory.

1. use case diagram, class diagram, and object Diagram

2. Sequence diagram and collaboration Diagram

3. Activity diagram and status diagram

4. Component diagram and deployment Diagram

In today's blog, I mainly talk about sequence and collaboration diagrams. In the previous article, we mainly described static views in UML. Next, we need to analyze and design the dynamic view of the system, and establish the corresponding dynamic model. The dynamic model describes the behavior of the system that changes over time. These behaviors are extracted from the static view. In UML, a dynamic model is mainly used to establish the interaction diagram and behavior diagram of the system. What I described in today's blog is the interaction diagram, which includes the sequence diagram and the cooperative plot. The two diagrams and their drawing skills are described in detail below.

Sequence Diagram


A sequence diagram describes the time sequence of passing messages between objects. It is an interaction diagram that emphasizes the time sequence of messages. Simply put, it describes how messages are transmitted and completed between objects in chronological order. A sequence diagram is a message transmitted by time. Therefore, it provides UML users with a clear and visualized track of the event stream over time.

Sequence diagram drawing skills: It is very interesting that a sequence diagram can be regarded as a special diagram in all UML diagrams. It can be said that as soon as you see the chart in this arrangement, you will know that it is a sequence diagram. In a sequence chart, all objects are arranged horizontally at the top of the graph. Even if you drag an object with the mouse, they are arranged in a column. In this way, there is a vertical dotted line at the bottom of each object, and the transmission between messages is represented by arrows, horizontally placed and perpendicular to these dotted lines. In addition, messages near the top of the arrow month are sent earlier. Speaking of this, I once suffered a loss and did not pay attention to the ascending and descending order of Arrow placement. The result showed that it was really messy, it is worth noting that others cannot clearly understand the order in which messages are sent, not to mention the order in which messages are sent.


Collaboration Diagram


Unlike a sequence diagram, a collaboration diagram emphasizes the structure information of each object that participates in the interaction. A collaboration chart is a type chart that can be seen as an extension of an object chart. However, in addition to displaying the association between objects, a collaboration chart also shows message transmission between objects. A collaboration diagram only models the relationships between objects that interact with each other and these objects, while ignoring other objects and relationships. This sentence is very important. It can be said that it is the key to collaboration graphs.

Cooperative graph: first, the interaction graph object is represented by a rectangle, and objects are connected in a straight line. This is said many times. Pay attention to what graphics are used to represent objects in different graphs and what relationship lines are used to describe the relationships between objects. Although this seems inconspicuous, it is the key to deciding whether to draw each graph successfully or not. Secondly, you can refer to the previously drawn object Diagram for drawing a collaboration diagram. However, the message transmission between objects should be displayed on the basis of the object diagram, which should be described by arrows and corresponding languages. In fact, a collaboration diagram also indicates the time sequence of information transmission. It is not represented by the positions placed by arrows as a sequence diagram, but by adding sequence numbers to messages.

Both the sequence diagram and the Collaboration diagram can represent the time sequence of message transmission, while the sequence diagram seems clearer and clearer. However, the collaboration diagram can show more complex branches than the sequence diagram. The two are complementary and have their own strengths, each has its own complement, but each has its own magical power.

(In the next article, I will introduce the behavior diagram, that is, the status chart and activity diagram)

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.