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: