Summary

How the system should do it

Sequence Diagram

  • iteration: doing something repeatedly (until a condition is satisfied)
  • self-called: an object sends a message to itself, which is represented by an arrow that loops back to the same lifeline. This is used to model recursive behavior or when an object needs to perform an operation on itself.
  • guard condition: a boolean expression that must be true for a message to be sent or an interaction to occur. It is typically enclosed in square brackets [] and placed near the message or interaction it governs. If the guard condition evaluates to false, the message will not be sent, and the interaction will not occur.

Object Notation:

  • object name: class name
    • tom : Student
  • : class name
    • : Student
  • object name
    • tom

Message Notation:

  • Call: synchronous call (the caller waits for the called operation to finish before continuing)
  • send: asynchronous call (the caller continues without waiting for the called operation to finish)
  • return: dashed line with an open arrowhead, indicating the return of control from the called operation to the caller, often accompanied by a return value or result.
  • <<create>> : create an instance of a class
  • <<destroy>> : destroy an instance of a class

Alternative Flow

Frame

Note

frame can also be nested

  • loop: loop until the condition is satisfied

  • opt: if the condition is satisfied, then execute the enclosed interactions; otherwise, skip them.

  • alt: represents alternative paths in the interaction. It consists of multiple sections, each with a guard condition that determines which path to take based on the evaluation of the conditions. Only one section will be executed, depending on which guard condition evaluates to true.