Interaction

From RAD Studio
Jump to: navigation, search

Go Up to UML 2.0 Interaction Diagrams

By using Modeling, you can create interactions for the detailed description and analysis of inter-process communications.

Interactions can be visually represented in your Modeling projects by means of the two most common interaction diagrams: Sequence and Communication. On the other hand, interactions can exist in projects without visual representation.

Interaction use

Within an interaction, you can refer to the other interactions described in your project. So called "Interaction use" elements serve this purpose. Note that referenced interaction can be explicitly defined from the model, or just specified as a text string.

Each interaction use is attached to its lifeline with a black dot. This dot is an individual diagram element. If an interaction use is expanded over several lifelines, you can delete the attachment dots from all lifelines but one. An interaction use should be connected with at least one lifeline.

Tie frame

Modeling makes it possible to spread combined fragments and interaction uses across several lifelines. This is done with the Tie Frame button of the diagram Tool Palette.

A frame can be attached to different points on the target lifeline. You choose the desired location on the target lifeline between the other elements and frames that belong to it. The frame shifts accordingly along the source lifeline.

It is important to understand that only those lifelines marked with dots are attached to the referenced interaction or combined fragment; lifelines that are only crossed by the frame are not attached. Attachment dots are separate diagram elements that can be selected and deleted.

Lifeline

A lifeline defines an individual participant of the interaction. A lifeline is shown in a sequence diagram as a rectangle followed by a vertical-dashed line.

Lifelines of an interaction can represent the parts defined in the class or composite structure diagrams. If the referenced element is multivalued, then the lifeline should have a selector that specifies which particular part is represented by this lifeline.

If a lifeline represents a connectable element, has type specified, or refers to another interaction, the Select menu becomes enabled on the context menu of this lifeline. Using this menu, you can navigate to the part, type or decomposition associated with the lifeline. These properties are defined by using the Object Inspector. If the represents property is set, the type and part properties are disabled.

You can define these properties manually by typing the values in the corresponding fields of the Object Inspector. If the specified values are not found in the model, they are displayed in single quotes. Such references are not related to any actual elements and the Select menu is not available for them. If the specified values can be resolved in the model, they are shown without quotes, and the Select menu is available for them.

State invariant

A state invariant is a constraint placed on a lifeline. This constraint is evaluated at run time prior to execution of the next execution specification. State invariants are represented in the interaction diagrams in two ways: as OCL expressions or as references to the state diagrams. You can use the state invariants to provide comments to your interaction diagrams and to connect interactions with states.

It is important to note that Modeling provides validation of the state invariants represented as OCL expressions. If the syntax is wrong, or there is no valid context, the constraint is displayed red. For example, a lifeline should have type and represents properties defined to be a valid context.

See Also