UML学习-sequesce diagram

Combined Fragments

  • Alternative fragment (denoted “alt”) models if…then…else constructs. 二选一
  • Option fragment (denoted “opt”) models switch constructs. 多选
  • Break fragment models an alternative sequence of events that is processed instead of the whole of the rest of the diagram.
  • Parallel fragment (denoted “par”) models concurrent processing. 并行分支
  • Weak sequencing fragment (denoted “seq”) encloses a number of sequences for which all the messages must be processed in a preceding segment before the following segment can start, but which does not impose any sequencing within a segment on messages that don’t share a lifeline.
  • Strict sequencing fragment (denoted “strict”) encloses a series of messages which must be processed in the given order.
  • Negative fragment (denoted “neg”) encloses an invalid series of messages.
  • Critical fragment encloses a critical section.
  • Ignore fragment declares a message or message to be of no interest if it appears in the current context.
  • Consider fragment is in effect the opposite of the ignore fragment: any message not included in the consider fragment should be ignored.
  • Assertion fragment (denoted “assert”) designates that any sequence not shown as an operand of the assertion is invalid.
  • Loop fragment encloses a series of messages which are repeated. 循环

下表列出了常用的组合片段:

片段类型

名称

说明

Opt

选项

包含一个可能发生或可能不发生的序列。 可以在临界中指定序列发生的条件。

Alt

抉择

包含一个片段列表,这些片段包含备选消息序列。 在任何场合下只发生一个序列。

可以在每个片段中设置一个临界来指示该片段可以运行的条件。 else 的临界指示其他任何临界都不为 True 时应运行的片段。 如果所有临界都为 False 并且没有 else,则不执行任何片段。

Loop

循环

片段重复一定次数。 可以在临界中指示片段重复的条件。

Loop 组合片段具有“Min”“Max”属性,它们指示片段可以重复的最小和最大次数。 默认值是无限制。

Break

中断

如果执行此片段,则放弃序列的其余部分。 可以使用临界来指示发生中断的条件。

Par

并行

并行处理。 片段中的事件可以交错。

Critical

关键

用在 Par 或 Seq 片段中。 指示此片段中的消息不得与其他消息交错。

Seq

弱顺序

有两个或更多操作数片段。 涉及同一生命线的消息必须以片段的顺序发生。 如果消息涉及的生命线不同,来自不同片段的消息可能会并行交错。

Strict

强顺序

有两个或更多操作数片段。 这些片段必须按给定顺序发生。

        有关如何解释序列的片段

        默认情况下,序列图表明可能发生的一系列消息。 在运行的系统中,可能会出现您未选择显示在关系图上的其他消息。

        以下片段类型可用于更改此释义:

片段类型

名称

说明

Consider

考虑

指定此片段描述的消息列表。 其他消息可发生在运行的系统中,但对此描述来说意义不大。

“Messages”属性中键入该列表。

Ignore

忽略

此片段未描述的消息列表。 这些消息可发生在运行的系统中,但对此描述来说意义不大。

“Messages”属性中键入该列表。

Assert

断言

操作数片段指定唯一有效的序列。 通常用在 Consider 或 Ignore 片段中。

Neg

否定

此片段中显示的序列不得发生。 通常用在 Consider 或 Ignore 片段中。

猜你喜欢

转载自wv1124.iteye.com/blog/1465498