2/1/2022

State Sequence Diagram

  1. Sequence Diagram Tutorial
  2. Sequence Diagram State Continuation
  3. State Pattern Sequence Diagram

Sequence diagram examples State machine diagram examples Timing diagram examples Use case diagram examples Use Case Diagrams Business Use Case Diagrams Airport check-in and security screening business model Restaurant business model. System Use Case Diagrams. What is a Sequence Diagram in UML? UML Sequence diagrams are interaction diagrams that detail how operations are carried out. As sequence diagrams can be used to capture the interaction between objects in the context of a collaboration, one of the primary uses of sequence diagrams is in the transition from requirements expressed as use cases to the next and more formal level of refinement.

State Sequence Diagram

Why State Machine Diagrams?

State design pattern sequence diagram

Sequence Diagram Tutorial

State machine diagram typically are used to describe state-dependent behavior for an object. An object responds differently to the same event depending on what state it is in. State machine diagrams are usually applied to objects but can be applied to any element that has behavior to other entities such as: actors, use cases, methods, subsystems systems and etc. and they are typically used in conjunction with interaction diagrams (usually sequence diagrams).

State sequence diagram

For example:

Consider you have $100,000 in a bank account. The behavior of the withdraw function would be: balance := balance - withdrawAmount; provided that the balance after the withdrawal is not less than $0; this is true regardless of how many times you have withdrawn money from the bank. In such situations, the withdrawals do not affect the abstraction of the attribute values, and hence the gross behavior of the object remains unchanged.

Sequence Diagram State Continuation

However, if the account balance would become negative after a withdrawal, the behavior of the withdraw function would be quite different. This is because the state of the bank account is changed from positive to negative; in technical jargon, a transition from the positive state to the negative state is fired.

The abstraction of the attribute value is a property of the system, rather than a globally applicable rule. For example, if the bank changes the business rule to allow the bank balance to be overdrawn by 2000 dollars, the state of the bank account will be redefined with condition that the balance after withdrawal must not be less than $2000 in deficit.

Note That:

State Pattern Sequence Diagram

  • A state machine diagram describes all events (and states and transitions for a single object)
  • A sequence diagram describes the events for a single interaction across all objects involved