UML Combat Sequence Diagrams and collaboration diagrams

Source: Internet
Author: User

Unlike in the past, this time the title contains the names of the two graphs, why the two graphs together to summarize and practice it. Because there are similarities or connections between them, what are these two diagrams for? Let's go into the UML world again and see what these two graphs are.

It is well known that in the course of UML modeling of the development system, the system's use case diagram and Class diagram and object graph are the description of the static structure of the system, if we want to describe the interaction between the dynamic model of the system and the object, we should use the UML behavior diagram, and the behavior diagram is divided into state diagram, activity diagram We're going to talk today. Diagram is an interaction diagram, in which the interaction diagram is divided into sequence diagrams and collaboration diagrams, which are used to describe the interaction between objects.

Sequence Diagram (Sequencediagrams): Describes the order of interactions between objects, focuses on the chronological order of message delivery between objects, emphasizes the order in which messages are sent between objects, and also shows the interaction between objects.

Collaboration Diagrams (Collaborationdiagrams): Also known as collaboration diagrams, describe the relationships between objects, and focus more on what objects have message passing.

It is important to note that sequence diagrams and collaboration diagrams can be converted to each other.

We first look at the sequence diagram, some also called the sequence diagram, the sequence diagram is mainly composed of objects, messages, lifelines, and the message refers to the communication between the object, can be a signal or operation call, the lifeline is to indicate a certain period of time the object exists.

The main forms of the message are: Call, return, send, create, destroy, etc., the classification of messages are:

Simple message: Represents a simple control flow

Synchronous message: Represents a nested control flow

Asynchronous message: Represents an asynchronous control flow

You can combine a simple message and a synchronous message into a single message,

For the sequence diagram and collaboration diagram, let's make a summary:

1 The two are semantically equivalent,

2 and they transform each other.

3 The focus of the two is different: The sequence diagram focuses on the time sequence, and the cooperation diagram focuses on the relationship between objects.

The following we take the computer room charge system for modeling objects to give a user login of a time series diagram and collaboration diagram, relatively simple, but also very good understanding, for the rest of the system can be modeled after the corresponding sequence diagram and collaboration diagram

Log in to the system timing diagram:

Collaboration diagram for one-click conversions:

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.