什么是时序图? (What is Sequence Diagram?)
Sequence Diagram is a "Connection Diagram" that represents a single structure or storyline executing in a system. It is the second most used UML diagram behind the class diagram. Sequence Diagram shows what message is to be sent and when.
顺序图是一个“连接图” ,表示在系统中执行的单个结构或故事情节。 它是在类图之后第二大最常用的UML图。 序列图显示了要发送什么消息以及何时发送。
A sequence diagram is a good way to visualize and ratify various runtime framework.
序列图是可视化和批准各种运行时框架的好方法。
顺序图 (Sequence diagram)
基本序列图符号 (Basic Sequence Diagram Notation)
Lifeline: Lifelines are vertical dotted lines that indicate the object's activity over time. Lifeline is a named element that represents an individual participant in the connection. While parts and structural properties may have multiplicity, lifelines represent only one interconnected entity.
生命线 :生命线是垂直虚线,指示对象随时间的活动。 生命线是一个命名元素,代表连接中的单个参与者。 尽管零件和结构特性可能有多种多样,但生命线仅代表一个相互联系的实体。
Messages: Messages are nothing but the arrows that represent calls between objects. Half-arrowed lines are used to represent asynchronous messages. Asynchronous messages are sent from an object that will not wait for a reply from the receiver before continuing its tasks.
消息 :消息不过是代表对象之间调用的箭头而已。 半箭头线用于表示异步消息。 异步消息是从对象发送的,该对象在继续执行任务之前不会等待接收者的答复。
Execution Occurrence: Execution boxes present the time an object needs to complete a task. When an object is busy executing a process or waiting for a reply message, use a thin gray rectangle placed vertically on its lifeline.
执行发生 :执行框显示对象完成任务所需的时间。 当对象忙于执行过程或等待回复消息时,请使用垂直放置在其生命线上的细灰色矩形。
Interaction Fragment: It is the named element that represents the most general interaction segment. Example of Interaction Fragment:
交互片段 :这是表示最一般的交互片段的命名元素。 交互片段示例:
- Occurrence
- Execution
- Interaction use
顺序图中的消息类型 (Types of message in sequence diagram)
Synchronous Message: It requires a response before the interaction can proceed. It's usually drawn using a line with a solid arrowhead pointing from one object to another.
同步消息 :在进行交互之前,需要响应。 通常使用带有实心箭头的线绘制,该线从一个对象指向另一个对象。
Asynchronous Message: It does not require a response before the interaction can proceed. It is usually drawn using an arrow.
异步消息 :在交互可以继续之前,不需要响应。 通常使用箭头绘制。
Reply Message: It is drawn by the dotted arrow moving backward to the original message.
回复消息 :由虚线箭头向后移动到原始消息。
Self Message: A message sent to itself and it is represented by the U shaped arrow.
自我信息 :发送给自己的信息,用U形箭头表示。
Found Message: A message sent from an unknown beneficiary, shown by an arrow from an endpoint to a lifeline.
找到的消息 :从未知受益人发送的消息,由从端点到生命线的箭头显示。
Lost Message: A message sent to an unknown beneficiary. It's shown by an arrow going from a lifeline to an endpoint, a filled circle or a cross(x).
丢失的消息 :发送给未知受益人的消息。 它由从生命线到终点的箭头,实心圆或十字(x)表示。
简单的端到端图 (Simple E2E Diagram)
Image Reference: https://www.sparxsystems.eu/resources/project-development-with-uml-and-ea/interaction-diagram/
图片参考:https://www.sparxsystems.eu/resources/project-development-with-uml-and-ea/interaction-diagram/
翻译自: https://www.includehelp.com/basics/the-sequence-diagram-software-engineering.aspx