时序图 Sequence Diagram
什么是时序图?
Sequence Diagrams show elements as they interact over time and they are organized according to object (horizontally) and time (vertically)
水平方向是角色,竖直方向是时间,这些元素交互是基于时间的
参考:https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/
角色有哪些 ?
Actor (参与者)
Lifeline(生命线)
Activation(活动)
Call Message (请求消息)
Return Message(响应消息)
Self Message(内部消息)
示例
复杂元素
Operator | Fragment Type |
---|---|
alt | Alternative multiple fragments: only the one whose condition is true will execute. |
opt | Optional: the fragment executes only if the supplied condition is true. Equivalent to an alt only with one trace. |
par | Parallel: each fragment is run in parallel. |
loop | Loop: the fragment may execute multiple times, and the guard indicates the basis of iteration. |
region | Critical region: the fragment can have only one thread executing it at once. |
neg | Negative: the fragment shows an invalid interaction. |
ref | Reference: refers to an interaction defined on another diagram. The frame is drawn to cover the lifelines involved in the interaction. You can define parameters and a return value. |
sd | Sequence diagram: used to surround an entire sequence diagram. |
举例
举例