Interaction (UML)

from Wikipedia, the free encyclopedia

An interaction ( Interaction ) is a model element in the Unified Modeling Language (UML), a modeling language for software and other systems.

The behavior of a modeled system can be specified in UML2 in different ways, for example by modeling it as an interaction . An interaction is the specification of a behavior that is described as the exchange of messages between objects. The interaction defines which objects are involved, which messages are exchanged between the objects in which order and which other behavioral elements, for example actions , start or end on the basis of these messages.

Lifelines

Lifelines

An interaction has a lot of lifelines (lifelines) . Lifelines represent the objects between which messages are exchanged in an interaction. In the figure on the right, for example, two lifelines are shown for one occurrence of the type Kochand one of the type Herd.

news

news

A message ( message ) is the communication unit that is exchanged in the communication between two objects. A message can represent one of three types of communication, namely

  1. for the synchronous call of an operation
  2. for the asynchronous call of an operation
  3. for the asynchronous transmission of a signal

In the case of synchronous messages, a normal message call occurs and control is passed to the called object. Asynchronous calls immediately return control to the calling object.

In the normal case of a message, two constructs are message-end (engl. MessageEnd ) is assigned. A message end is either a connection point or the specification of an event occurrence. For example, if a message represents the synchronous call of an operation, the end of the sender message will represent a SendOperationEvent , and the end of the recipient message will represent a CallEvent .

UML2 allows two exceptions to this rule, in that either the sender message end or the receiver message end can be omitted. In the first case of a UML 2 speaks found (engl. Found ) in the second of a lost (engl. Lost ) message. If, as provided in the normal case, both message-end are specified, it is called a complete (Engl. Complete ) message.

Semantic model

Semantic model

Anyone modeling interactions assumes that the modeled system consists of a network of objects that exchange messages with one another. Sends an object to another object a message that can be two event Self identify: first, the occurrence of a message event , when the message is sent from the first object, and secondly of a message event when the message arrives at the second object. Other events occur when an action or other behavior begins or ends in the context of an object. A track ( trace ) refers to a series of such events. Interactions now specify behavior as two sets of traces, a set of valid and a set of invalid traces.

For example, the figure on the right shows two messages with a total of four specifications of event occurrences S1, S2, R1, R2. Because the message einschalten()and ausschalten()are in sync, you have R1to S1or R2to S2follow. S2can only occur when S1and R1have occurred. This interaction stands for a behavior that is characterized by the following admissible trace with four events:<S1, R1, S2, R2>

Parameters and connection points

Parameters and connection points

Like any behavior specification, an interaction can have a number of formal parameters . When calling the behavior that is specified by the interaction, the caller can provide current values ​​for each parameter.

Interactions can also have a number of connection points . Connection points are a kind of gateway for messages that flow from outside, for example from an encircling interaction into an interaction or leave an interaction for an encompassing interaction.

notation

Interactions are graphically represented in sequence diagrams , communication diagrams , and timing diagrams. The numerous notation details for the graphical representation of the various types of news, lifelines and event occurrences are explained there.

literature

  • Heide Balzert: Textbook of Object Modeling - Analysis and Design with UML 2 Elsevier Spectrum Akademischer Verlag, 2005, ISBN 3-8274-1162-9