Explain of Interaction Operators in UML?

来源于:EA 中的 Interaction Operators Enterprise Architect User Guide


Operator


Action


alt


Divide up interaction fragments based on Boolean conditions.


opt


Enclose an optional fragment of interaction.


par


Indicate that operands operate in parallel.


loop


Indicate that the operand repeats a number of times, as specified by interaction constraints.


critical


Indicate a sequence that cannot be interrupted by other processing.


neg


Assert that a fragment is invalid, and implies that all other interaction is valid.


assert


Specify the only valid fragment to occur. This operator is often enclosed within a consider or ignore operand.


strict


Indicate that the behaviors of the operands must be processed in strict sequence.


seq


Indicate that the Combined Fragment is weakly sequenced. This means that the ordering within operands is maintained, but the ordering between operands is undefined, so long as an event occurrence of the first operand precedes that of the second operand, if the event occurrences are on the same lifeline.


ignore


Indicate which messages should be ignored during execution, or can appear anywhere in the execution trace.


consider


Specify which messages should be considered in the trace. This is often used to specify the resulting event occurrences with the use of an assert operator.


ref


Provide a reference to another diagram.

The ref fragment is not created using the method described in the Create a Combined Fragment topic. To create a ref fragment, simply drag an existing diagram from the Project Browser onto the current diagram.

Learn more

· Combined Fragments
· Create a Combined Fragment
 

OMG UML
Specification

The OMG UML specification
(UML Superstructure
Specification, v2.1.1, p. 468-471)
states:

The semantics of a CombinedFragment is
dependent upon the interactionOperator as explained below.

Alternatives

The interactionOperator alt
designates that the CombinedFragment represents a choice of behavior. At most
one of the operands will be chosen. The chosen operand must have an explicit or
implicit guard expression that evaluates to true at this point in the
interaction. An implicit true guard is implied if the operand has no
guard.

The set of traces that defines a choice
is the union of the (guarded) traces of the operands.

An operand guarded by else
designates a guard that is the negation of the disjunction of all other guards
in the enclosing CombinedFragment.

If none of the operands has a guard
that evaluates to true, none of the operands are executed and the remainder of
the enclosing InteractionFragment is executed.

Option

The interactionOperator opt
designates that the CombinedFragment represents a choice of behavior where
either the (sole) operand happens or nothing happens. An option is semantically
equivalent to an alternative CombinedFragment where there is one operand with
non-empty content and the second operand is empty.

Break

The interactionOperator break
designates that the CombinedFragment represents a breaking scenario in the sense
that the operand is a scenario that is performed instead of the remainder of the
enclosing InteractionFragment. A break operator with a
guard is chosen when the guard is true and the rest of the enclosing Interaction
Fragment is ignored. When the guard of the break operand is false,
the break operand is ignored and the rest of the enclosing
InteractionFragment is chosen. The choice between a break operand without a
guard and the rest of the enclosing InteractionFragment is done
non-deterministically.

A CombinedFragment with
interactionOperator break should cover all
Lifelines of the enclosing InteractionFragment.

Parallel

The interactionOperator par
designates that the CombinedFragment represents a parallel merge between the
behaviors of the operands. The OccurrenceSpecifications of the different
operands can be interleaved in any way as long as the ordering imposed by each
operand as such is preserved.

A parallel merge defines a set of
traces that describes all the ways that OccurrenceSpecifications of the operands
may be interleaved without obstructing the order of the OccurrenceSpecifications
within the operand.

Weak Sequencing

The interactionOperator seq
designates that the CombinedFragment represents a weak sequencing between the
behaviors of the operands.

Weak sequencing is defined by the set
of traces with these properties:

1. The ordering of
OccurrenceSpecifications within each of the operands is maintained in the
result.
2. OccurrenceSpecifications on different lifelines from
different operands may come in any order.
3. OccurrenceSpecifications on the same lifeline from
different operands are ordered such that an OccurrenceSpecification of the first
operand comes before that of the second operand.

Thus weak sequencing reduces to a
parallel merge when the operands are on disjunct sets of participants. Weak
sequencing reduces to strict sequencing when the operands work on only one
participant.

Strict Sequencing

The interactionOperator strict
designates that the CombinedFragment represents a strict sequencing between the
behaviors of the operands. The semantics of strict sequencing defines a strict
ordering of the operands on the first level within the CombinedIFragment with
interactionOperator strict. Therefore
OccurrenceSpecifications within contained CombinedFragment will not directly be
compared with other OccurrenceSpecifications of the enclosing
CombinedFragment.

Negative

The interactionOperator neg
designates that the CombinedFragment represents traces that are defined to be
invalid.

The set of traces that defined a
CombinedFragment with interactionOperator negative is equal to the set of traces
given by its (sole) operand, only that this set is a set of invalid rather than
valid traces. All InteractionFragments that are different from Negative are
considered positive meaning that they describe traces that are valid and should
be possible.

Critical Region

The interactionOperator critical
designates that the CombinedFragment represents a critical region. A critical
region means that the traces of the region cannot be interleaved by other
OccurrenceSpecifications (on those Lifelines covered by the region). This means
that the region is treated atomically by the enclosing fragment when determining
the set of valid traces. Even though enclosing CombinedFragments may imply that
some OccurrenceSpecifications may interleave into the region, such as with
par-operator, this is prevented by defining a region.

Thus the set of traces of enclosing
constructs are restricted by critical regions.

Ignore / Consider

(p. 473) The interactionOperator
ignore designates that there are some message types that are not shown
within this combined fragment. These message types can be considered
insignificant and are implicitly ignored if they appear in a corresponding
execution. Alternatively one can understand ignore to mean that the
messages that are ignored can appear anywhere in the traces.

Conversely the interactionOperator
consider designates which messages should be considered within this
CombinedFragment. This is equivalent to defining every other message to be
ignored.

Assertion

The interactionOperator assert
designates that the CombinedFragment represents an assertion. The sequences of
the operand of the assertion are the only valid continuations. All other
continuations result in an invalid trace. Assertions are often combined with
Ignore or Consider.

Loop

The interactionOperator loop
designates that the CombinedFragment represents a loop. The loop
operand will be repeated a number of times.

The Guard may include a lower and an
upper number of iterations of the loop as well as a Boolean expression. The
semantics is such that a loop will iterate minimum the ‘minint‘ number of times
(given by the iteration expression in the guard) and at most the ‘maxint‘ number
of times. After the minimum number of iterations have executed, and the boolean
expression is false the loop will terminate. The loop construct represent a
recursive application of the seq operator where the
loop operand is sequenced after the result of earlier
iterations.

The Semantics of Gates

The gates of a CombinedFragment
represent the syntactic interface between the CombinedFragment and its
surroundings, which means the interface towards other
InteractionFragments.

The only purpose of gates is to define
the source and the target of messages.

时间: 2024-10-05 12:14:00

Explain of Interaction Operators in UML?的相关文章

关于UML图形/图示数量总结

http://www.uml.org/ 第一种说法: UML - Unified Modeling Language UML 共定义了9种图,包括4种结构图和5种形为图: //4种结构图: 类图 对象图 构件图 实施图 //5种行为图: 用况图 顺序图 协作图 状态图 活动图 文章: 深入剖析建模工具UML中有哪些UML图-http://developer.51cto.com/art/201007/209441.htm UML图-http://baike.baidu.com/view/19389

Design Pattern Explain 读书笔记一 重新认识面向对象|规范使用UML

新视角看面向对象 与 UML图 什么是内聚性 closely the operations in a routine are related. 就是一个类中,各个方法之间的联系的紧密程度. 内聚就是一个模块内各个元素彼此结合的紧密程度,高内聚就是一个模块内各个元素彼此结合的紧密程度高. 所谓高内聚是指一个软件模块是由相关性很强的代码组成,只负责一项任务,也就是常说的单一责任原则. 低内聚就是说一个类中各个方法直接没有关系,最极端的例子就是,这个类中的方法几乎与系统中所有的东西纠缠在一起. 高内聚

UML的价值,如何用,有何成就感

现在在做Microsoft Visio的tool validation,做到UML的时候,觉得,阿,没意思,内心快成一片死海了. 没感情,没激情. 那UML要不要用?如何对待? 我查了一下google的数据库,有一句话击中了我的心: I think UML diagrams can only be useful if they express something in a higher level of abstraction than your code. 完整的答案在下面: I think

MySQL EXPLAIN Output Format(MySQL运维神技)

摘要: DBA经常会用到的explain来查看SQL语句的执行计划,今天小人斗胆,从MySQL 5.7 Reference Manual中把MySQL EXPLAIN Output Format翻译过来.欢迎拍砖 Explain语句提供了一个select语句执行计划的信息. Explain为每个用了select语句的表,返回一行信息.它列出了表中的顺序输出,MySQL会读取他们,然后再处理.MySQL解决了所有使用嵌套循环连接方法.这意味着MySQL会读取第一个表中的一行,然后在第二个表中找到一

Rational Rose与UML教程

在学UML的过程中,Rational Rose的角色无比重要.现在能找到的大多数是2003的,但下面连接是2007. http://blog.csdn.net/skl_TZ/article/details/8925152 这个教程会教会你用Rational Rose.包括用例图,类图,时序图,协作图和状态图的绘制. 启动Rational Rose后,它会提示你去创建新模型.有一些模型给你选择.在这个教程中,我们会选择J2EE模型.如果你有已存在的模型,选择“”“Existing”标签或“Rece

UML简介

Unified Modeling Language (UML)又称统一建模语言或标准建模语言,是始于1997年一个OMG标准,它是一个支持模型化和软件系统开发的图形化语言,为软件开发的所有阶段提供模型化和可视化支持,包括由需求分析到规格,到构造和配置. 面向对象的分析与设计(OOA&D,OOAD)方法的发展在80年代末至90年代中出现了一个高潮,UML是这个高潮的产物.它不仅统一了Booch.Rumbaugh和Jacobson的表示方法,而且对其作了进一步的发展,并最终统一为大众所接受的标准建模

UML建模学习1:UML统一建模语言简介

一什么是UML? Unified Modeling Language(UML又称为统一建模语言或标准建模语言)是国际对象管理组织OMG制定的一个通 用的.可视化建模语言标准,可以用来描述(specify).可视化(visualize).构造(construct)和记载(document)软件密集 型系统的各种工件(artifacts,又译为制品). UML是一个支持模型化和软件系统开发的图形化语言,为软件开发的所有阶段提供模型化和可视化支持,包括由 需求分析到规格,到构造和配置. UML是面向对

UML建模学习2:UML基本构造块之事物

一UML中的事物 构成模型图的一些基本图示符号,它们表示一些面向对象的基本概念. UML中有四类事物Structural Things(结构事物), Behavioral Things(行为事物), Group Things(分组事物), Annotational Things(注释事物). 二UML中的四类事物(Things) (1)结构事物 结构事物是模型中的静态部分,用以呈现概念或实体的表现元素,是软件建模中最常见的元素,共有以下七种: A类(class) 类是对一组具有相同属性.方法.关

UML建模——使用EA工具开发时序图实践及经验

Enterprise Architect(以下简称EA)是一款基于OMG UML的可视化模型与设计工具,提供了对软件系统的设计和构建.业务流程建模和基于领域建模的支持,被企业和组织不仅应用于对系统的建模,还用于推进模型在整个应用程序开发周期中实现. 在EA工具建模平台上,提供如下常用设计模型: Business Process   业务流程模型 Requirements   需求分析模型 Use Case       用例模型 Domain Model    领域模型 Class