What do the vertical rectangles convey in a UML sequence diagram?

限于喜欢 提交于 2019-12-05 15:06:53
0decimal0

The vertical rectangles denote execution specification.

  • Execution specification is a part of object's interaction which represents period of object's lifetime when it is either doing some activity or simply waiting for the reply from other object. By some activity I mean sending messages etc. Length of the rectangle however, are irrelevant. You may or may not draw these as they are not compulsory.
    The example with a diagram is given below:

For details the following link can be looked upon.

No, the height of the rectangles is irrelevant. It could be the case that you need to make the rectangle higher in order to accomodate more messages.

Formally, the rectangle is an ExecutionSpecification, and the dashed line is a Lifeline. The UML spec says that:

The order of OccurrenceSpecifications along a Lifeline is significant denoting the order in which these OccurrenceSpecifications will occur. The absolute distances between the OccurrenceSpecifications on the Lifeline are, however, irrelevant for the semantics.

(OccurrenceSpecifications are syntactic points at the ends of Messages or at the beginning/end of an ExecutionSpecification.)

If you want to model the duration of the execution, you should write a DurationConstraint along the the ExecutionSpecification. There is an example here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!