What do the vertical rectangles signify in a UML sequence diagram?
For example I want to know the meaning of the rectangle pointed to by the green arrow. Do the height of these rectangles mean anything?
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.
来源:https://stackoverflow.com/questions/15290291/what-do-the-vertical-rectangles-convey-in-a-uml-sequence-diagram