CS3340:   Intro OOP and Design

 

UML- Use Case

Describe how a system interacts with its environment: typical interactions involving its users.

 

Use Case = goal-oriented collaboration between a system and an actor

Actor = a user adopting a particular role.

Agent = like actor

Action = any goal-oriented collaboration, activity, task, operation or job connecting agents in a business, system or project.

 

 

Use-Case description

name

goal

The goal represents its specification: the result(s) it achieves, and/or a condition that it maintains.

participants

parameters

the objects involved (actively or passively) that are different from one occurrence of the use case to another.

pre-condition (optional)

a statement defining under what conditions the use case makes sense.

post-condition (optional)

a statement defining changes after use-case executed.

NOTE: Can use UML's Object Constraint Language (OCL) to format these description fields

 

Example: Use-Case Diagram and Description

use case: buy_thing

participants: (Purchaser, Vendor, Thing)

pre-condition:

  • vendor.possessions -> includes thing
  • purchaser.pocket >= thing.price

post-condition:

  • vendor.possessions = vendor.possessions - thing
  • purchaser.possessions = purchaser.possessions + thing
  • vendor.till = vendor.till@pre + thing.price
  • purchaser.pocket = purchaser.pocket@pre - thing.price

 

© Lynne Grewe