UML Dynamic Diagrams

The main behavior or dynamic diagrams in UML are

  • Interaction diagrams are:
    • Sequence diagrams
    • Collaboration diagrams
  • State chart diagrams
  • Activity diagrams

 

UML Interaction Diagrams

  • Interaction diagrams describe how groups of objects collaborate to get the job done.
  • Interaction diagrams capture the behavior of a single use case, showing the pattern of interaction among objects.
  • Diagram shows a number of example objects and the messages passed between those objects within the use case
  • 2 kinds of interaction diagrams
    • Sequence diagrams
    • Collaboration diagrams

UML Sequence Diagram

  • Sequence diagrams are an easy and spontaneous way of describing the behavior of a system by viewing the interaction b/n the system and its environment.
  • shows how processes operate with one another and in what order.
  • A sequence diagram shows an interaction arranged in a time sequence.
  • Sequence diagrams are sometimes called event diagrams, event scenarios, and timing diagrams

 

  • Sequence diagram has two dimensions
    • Vertical dimension represents time
    • Horizontal dimension represents different objects
    • Vertical line is called the object’s lifeline
  • Represents the object’s existence during the interaction
    • Very simple and has immediate visual appeal
    • To understand the overall flow of the control of a program

 

Object – box at the top of a dashed vertical line

Object role – vertical dashed line, life line

Message – an arrow b/n the lifelines of two objects

Order in which these messages occur is shown top to bottom on the page

Each message is labeled with the message name.

 

Restaurant sequence diagram

  • Describes the sequences of messages of a (simple) restaurant system
  • The dotted lines extending downwards indicate the timeline.
  • Long rectangle – activation boxes
  • The arrows represent messages (stimuli) from an actor or object to other objects
  • Half arrows indicate asynchronous method calls
  • Big X deletion of a participant

Student enrolling in a seminar