USE CASES

In the use case modeling approach, functional requirements are described in terms

of actors, which are users of the system, and use cases. A use case defines a sequence

of interactions between one or more actors and the system. In the requirements

phase, the use case model considers the system as a black box and describes the

interactions between the actor(s) and the system in a narrative form consisting

of user inputs and system responses. The use case model describes the functional

requirements of the system in terms of the actors and use cases. The system is treated

as a black box – that is, dealing with what the system does in response to the actor's

inputs, not the internals of how it does it. During subsequent analysis modeling (see

Chapter 8), the objects that participate in each use case are determined.

A use case always starts with input from an actor. A use case typically consists

of a sequence of interactions between the actor and the system. Each interaction

consists of an input from the actor followed by a response from the system. Thus, an

actor provides inputs to the system and the system provides responses to the actor.

The system is always considered as a black box, so that its internals are not revealed.

Whereas a simple use case might involve only one interaction between an actor and

the system, a more typical use case will consist of several interactions between the

actor and the system. More complex use cases might also involve more than one

actor.

Consider a simple banking example in which an automated teller machine

(ATM) allows customers to withdraw cash from their bank accounts. There is one

actor, the ATM Customer, and one use case, Withdraw Funds, as shown in Figure 6.1.

The Withdraw Funds use case describes the sequence of interactions between the

ATM Customer

Withdraw Funds

Figure 6.1. Example of actor and use case

Use Case Modeling 75

customer and the system; the use case starts when the customer inserts an ATM

card into the card reader, then responds to the system's prompt for the PIN, and

eventually receives the cash dispensed by the ATM machine