Learning notes of sequence diagram
in Note with 0 comment
Learning notes of sequence diagram
in Note with 0 comment

Sequence Diagram, also called sequence diagram or sequential diagram, is a UML behavior diagram. It displays dynamic collaboration among multiple objects by describing the time sequence of sending messages between objects. It can represent the sequence of use case behavior. When a use case behavior is executed, each message in the sequence diagram corresponds to a class operation or trigger event in the state machine that causes the transition. via: wiki

brief introduction

Sequence diagram definition: describes the time sequence of messages transmitted between objects. It is used to represent the behavior sequence in use cases. It is an interaction diagram that emphasizes the time sequence of messages

Things described by the sequence diagram: the sequence diagram describes the interactions between classes in the system, and models these interactions as message exchanges. The sequence diagram describes the classes and the messages of the expected behavior to complete the exchange between classes. Each message in the sequence diagram represents an operation of the class or a trigger event that causes the change of the state machine

Time sequence diagram representation: the objects participating in the interaction are arranged horizontally at the top of the time sequence diagram, and a vertical dotted line is drawn at the bottom of each object. Object A sends messages to object B, which is represented by a solid line with an arrow. The solid line starts from the dotted line at the bottom of object A and ends at the dotted line at the bottom of object B; The solid arrows are placed horizontally, and the closer they are to the top, the earlier they are sent

Sequence diagram track: the sequence diagram provides a clear visual track over time

Sequence Diagram Elements

The modeling elements included in the sequence diagram mainly include: object, lifeline, activation, message, etc

object

Object: The object in the sequence diagram plays a role in the interaction

Object symbol: objects in the sequence diagram are represented in the same way as objects in the object diagram. The object name is contained in a rectangle and underlined

Object creation timing: objects can be created at the beginning of interaction or during interaction

lifeline

Lifeline: A lifeline is a vertical dotted line, which indicates the existence of objects. In the sequence diagram, there is a lifeline at the bottom of each object

Lifeline function: Lifeline is a timeline, which exists from the top to the bottom of the sequence diagram, and its length depends on the interaction time

Lifeline of objects: objects and lifelines together are the lifelines of objects. This concept includes object icons and lifeline icons below objects

activation

Activation: represents the period when an object in the sequence diagram executes an operation. The activation period can be understood as the content in {} in semantics, indicating that the object is occupied to complete a task

Deactivation: refers to that the object is idle and waiting for a message to activate it

Activation representation: when the object is in the activation period, the lifeline can be widened to a rectangle, and this rectangular bar becomes the activation bar

Time for activation and deactivation:

news

Message concept: defines the class of information exchange in interaction and collaboration, and models the communication content between objects

Message action:

Asynchronous and synchronous communication of messages:

Difference between messages in sequence diagram and collaboration diagram: messages in sequence diagram emphasize order, and messages in collaboration diagram emphasize relationship between objects exchanging messages

reference resources

www.ibm.com/developerworks/cn/rational/rationaledge/content/feb05/bell/3101.html

blog.csdn.net/shulianghan/article/details/17927131

design-patterns.readthedocs.org/zh_CN/latest/read_uml.html

Responses