- Forward


Sequence and Communication Diagrams
for Engineering Design


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu

Print

Sequence Diagrams
Back SMYC Forward
  • Purpose:
    • Represent dynamic interactions between objects/classes
  • Focus:
    • The message (i.e., method call) sequence
Lifelines
Back SMYC Forward
  • Purpose:
    • Represent objects, roles, or classes over time and consist of a rectangle (representing the object/class) and a dashed line (representing time)
  • Visualization:
    • sequence_lifeline
  • Notes:
    • The class of the object can be omitted
    • The name/identifier can be omitted (in which case the instance is said to be anonymous/unnamed)
    • Instances should be underlined and roles/classes should not be (but this can be difficult to achieve with some tools)
Synchronous Messages
Back SMYC Forward
  • Purpose:
    • The sender waits for the receiver to process the message
  • Visualization:
    • sequence_simple
  • Notes:
    • The return need not be explicit
    • The activation/focus of control need not be included
    • The sequence number need not be included
    • Sequence numbers need not be hierarchical
Asynchronous Messages
Back SMYC Forward
  • Purpose:
    • The sender continues executing immediately after the message is sent
  • Visualization:
    • sequence_asynchronous
  • Notes:
    • Asynchronous messages do not have returns (in the normal sense)
Delays
Back SMYC Forward
  • Defined:
    • A significant amount of time relative to the process of interest
  • Visualization:
    • sequence_delay
  • Notes:
    • Delays should only be modeled when it is important to do so
    • Always check carefully for potential synchronization problems! (For example, what problems might arise in this example?)
Object Creation and Destruction
Back SMYC Forward
  • Creation:
    • Use a Create Message
  • Destruction:
    • Use a Destroy Message
  • Example:
    • sequence_createdelete
Self Messages and Recursion
Back SMYC Forward
  • An object can send itself a message
    • sequence_self
  • Messages can be recursive
    • sequence_recursion
Found and Lost Messages
Back SMYC Forward
  • Found Messages have a sender that is not modeled
    • sequence_found
  • Lost Messages have a receiver that is not modeled
    • sequence_lost
Combined Fragments
Back SMYC Forward
  • Purpose:
    • Used to group sets of messages together
  • Some Types:
    • alt (Alternatives like: if-then, switch)
    • opt (Optionals like: if)
    • loop
    • par (Parallel Execution)
    • assert (Assertions)
  • Example:
    • sequence_loop
Communication Diagrams
Back SMYC Forward
  • Purpose:
    • Represent dynamic interactions between objects/classes
  • Notes:
    • Are functionally equivalent to sequence diagrams
    • Are better at handling large numbers of objects because the vertical dimension is not used to represent time
    • Require sequence numbers to represent time
Communication Diagrams (cont.)
Back SMYC Forward

An Example (Centralized Control)

collaboration_centralized
There's Always More to Learn
Back -