Vending Machine (UML Sequence Diagram)

A UML sequence diagram example that shows the process of buying a drink by a customer and making it by a vending machine.

Sequence Diagram for Vending Machine

The example shows drink preparation by a vending machine. The lifelines represent a user (customer), a machine, and its parts. The sequence diagram shows interactions between the lifelines in the form of messages. It shows the process of how the customer chooses a drink, pays for it, and the machine prepares it.

Vending Machine (UML Sequence Diagram)
Vending Machine (UML Sequence Diagram)

The diagram shows these lifelines:

  • Vending Machine
  • Customer
  • Cup Feeder
  • Water Supply
  • Syrup Canister

There are these interactions between the lifelines:

  • Choose a drink
  • Show price
  • Add sugar
  • [is the chosen drink good with milk] Add milk
  • Insert money
  • Change due
  • Eject a cup
  • Drip the syrup for the chosen drink
  • Fill water
  • Drink completed notification

UML Sequence Diagram Concepts

The sequence diagram example shows lifelines and an actor lifeline, call messages, reply messages, and a self message. An optional (opt) fragment is used for a sequence action that does not need to be performed.

Download UML Sequence Diagram for Vending Machine

Drink Vending Machine (UML Sequence Diagram)

New Comment

Comment