Kihagyás

Communication diagram

Easy, understandalbe diagram that shows which componenst with what methods communicate to others.

Example

Major elements in communication

Frame

There is no specific long or short form name for communication diagram heading types.

interaction and sd can be used as communication's label

Interaction SD

Lifeline

Lifeline is a specialization of named element which represents an individual participant in the interaction

A Lifeline is shown as a rectangle (corresponding to the "head" in sequence diagrams). Lifeline in sequence diagrams does have "tail" representing the line of life whereas "lifeline" in communication diagram has no line, just "head".

Lifeline Notation

lifeline-ident ::= ([ connectable-element-name [ '[' selector ']' ] ] [: class-name ] [decomposition] ) \| 'self'
selector ::= expression
decomposition ::= ‘ref’ interaction-ident [ 'strict' ]

Classifier

Anonymous Named Indexed
Anonim classifier named classifier Indexed classifier
only the class is specified Class and the variable name is specified x of class X is selected with the selector [k]

Message

Example message

This is the whole point of the communication diagram

Method calls, order, guards and directions this is about

Sequence expression

The sequence expression is a dot separated list of sequence terms followed by a colon (:) and message name after that:

sequence-expression ::= sequence-term '.' . . . ':' message-nam

For example 3b.2.2:m5 contains sequence expression 3b.2.2 and the message name is m5

Sequence term

sequence-term ::= [ integer [ name ] ] [ recurrence ]

The integer represents the sequential order of the message within the next higher level of procedural calling (activation). Messages that differ in one integer term are sequential at that level of nesting.

For example,

  • message with sequence 2 follows message with sequence 1,
  • 2.1 follows 2
  • 5.3 follows 5.2 within activation 5
  • 1.2.4 follows message 1.2.3 within activation 1.2.

Sequence expression

Concurency

Instance of A sends draw() message to intance of B, and after that B sneds paint() to C

The name represents a concurrent thread of control. Messages that differ in the final name are concurrent at that level of nesting.

  • messages 2.3a and 2.3b are concurrent within activation 2.3,
  • 1.1 follows 1a and 1b,
  • 3a.2.1 and 3b.2.1 follow 3.2.

Concurrent call example

Instance of A sends draw() messages concurrently to instance of B and to instance of C

Guards

  • 2.3b [x>y]: draw()
    • message draw() will be executed if x is greater than y,
  • 1.1.1 [s1.equals(s2)]: remove()
    • message remove() will be executed if s1 equals s2.

Guarded message example

Instance of class A will send message draw() to the instance of C, if x > y

Repetition (iteration)

An iteration specifies a sequence of messages at the given nesting depth. UML does not specify iteration-clause syntax, so it could be expressed in pseudocode, some programming language, or something else. Iteration clause may be omitted, in which case the iteration conditions are unspecified.

The * iteration notation specifies that the messages in the iteration will be executed sequentially. The *|| (star followed by a double vertical line) iteration notation specifies concurrent (parallel) execution of messages.

  • 4.2c *[i=1..12]: search(t[i])
    • search() will be executed 12 times, one after another
  • 4.2c *||[i=1..12]: search(t[i])
    • 12 search() messages will be sent concurrently,
  • 2.2 *: notify()
    • message notify() will be repeated some unspecified number of times.

Iteration example 1

Instance of class A will send search() message to instance of B n times, one by one

Iteration example 2

Instance of class A will send n concurrent search() messages to instance of B

Yes, || is the paralel message's symbol