Skip to main content

Coffee vending machine use case diagram

Short answer

Actors: Customer and Service Staff. Customer use cases: Order Coffee includes Select Recipe, Pay with Coins, Dispense Coffee; Give Change extends Pay with Coins. Service Staff use cases: Load Ingredients and Add Recipe.

For the case study given below identify all the actors, use cases and relationships also draw use case diagram. A coffee Vending Machine dispenses coffee to customers. Customers order coffee by selecting a recipe from a set of recipes. Customers pay for the coffee using coins. Change is given back if any to the customers. The Services staff loads ingredients (coffee powder, milk, sugar, water and chocolate) into the coffee machine. The service staff can also add a recipe by indicating the name of the coffee, the units of coffee powder, milk, sugar, water and chocolate to be added as well as the cost of the coffee.

Actors: Customer and Service Staff (both are primary actors).

Use cases

  • Customer: Order Coffee, which includes Select Recipe (choose a recipe from the set of recipes), Pay with Coins and Dispense Coffee. Give Change extends Pay with Coins.
  • Service Staff: Load Ingredients (coffee powder, milk, sugar, water, chocolate) and Add Recipe (name of the coffee, units of each ingredient, cost).

Relationships

  • Order Coffee includes Select Recipe, Pay with Coins and Dispense Coffee.
  • Give Change extends Pay with Coins. It happens only if the money inserted is more than the cost.
  • Dispense Coffee checks that enough ingredients are available.
              +-----------------------------------+
              |   Coffee Vending Machine          |
              |                                   |
 [Customer] --|-( Order Coffee )                  |
              |    |include  |include  |include   |
              |    v         v         v          |
              |( Select  ( Pay with  ( Dispense   |
              |  Recipe ) Coins )     Coffee )    |
              |              ^                    |
              |              |extend              |
              |         ( Give Change )           |
              |                                   |
 [Service  ] -|-( Load Ingredients )              |
 [Staff    ] -|-( Add Recipe )                    |
              +-----------------------------------+
ElementType
CustomerPrimary actor
Service StaffPrimary actor
Order Coffee, Select Recipe, Pay with Coins, Dispense Coffee, Give ChangeCustomer use cases
Load Ingredients, Add RecipeService staff use cases
include / extendRelationships between the use cases above

✓ Answer checked by Claude Sonnet 5.5

All Object Oriented Analysis and Design chapter 2 questions →