UML : Interaction Diagrams with Example

  • An interaction diagram is a graphical representation of how objects interact with one another in a scenario.
  • They capture the behavior of a single use case, showing the pattern of interaction among objects.
  • Objects communicate in an interaction diagram by sending messages.
  • Sending a message typically corresponds to invoking a method or function, where the message name is the name of the method.
  • A message may carry data as parameters being passed.

UML provides two forms of interaction diagrams :
A. Sequence diagrams
B. Collaboration diagrams

Since we have only sequence diagram here are some tips and some information about sequence diagram

Sequence Diagram shows an interaction arranged in a time sequence. It has two dimensions :

1.Vertical Dimension representing time
2.Horizontal Dimension representing different objects.

 Sequence Diagram : Objects

  • An object is shown as a box of at the top of the dashed vertical line also know as the lifeline of the object.
  • It represents the object’s existence during the interaction. 

Sequence Diagram : Message 
  • An interaction is a set of messages exchanged among a set of objects to accomplish a particular purpose within a given context (such as a collaboration).
  • A message is a conveyance of information from one object to one or more other objects with the expectation that activity will ensue, in the form of an action.
  • A message can be either a signal or a call. 
  • Within a process or a thread, messages are ordered in sequence by time.

Sequence Diagram : Recursion And Delegation

An Example:  Sequence Diagram of An Airline Reservation Syatem