Object-Oriented Analysis and Design 337
11
A use case is a description of the interaction between an actor and the system itself. For
purposes of use-case analysis, the system is treated as a “black box.” An actor “sends a
message” to the system, and something happens: Information is returned; the state of the
system is changed; the spaceship changes direction; whatever.
Use cases are not sufficient to capture all of the requirements, but they are a key compo-
nent and often receive the most attention. Other items might include business rules, data
elements, and technical requirements for performance, security, and so on.
Identifying the Actors
It is important to note that not all actors are people. Systems that interact with the system
you are building are also actors. Thus, if you are building an automated teller machine
(ATM), the customer and the bank clerk can both be actors—as can other systems with
which the new system interacts, such as a mortgage-tracking or student-loan system. The
essential characteristics of actors are as follows:
- They are external to the system.
- They interact with the system.
Getting started is often the hardest part of use-case analysis. Often, the best
way to get going is with a “brainstorming” session. Simply write down the
list of people and systems that will interact with your new system.
Remember that peoplereally means roles—the bank clerk, the manager, the
customer, and so forth. One person can have more than one role.
TIP
For the ATM example just mentioned, the list of roles would include the following:
- The customer
- The bank personnel
- A back-office system
- The person who fills the ATM with money and supplies
No need exists to go beyond the obvious list at first. Generating even three or four actors
might be enough to get you started on generating use cases. Each of these actors interacts
with the system in different ways. You need to capture these interactions in the use cases.
Determining the First Use Cases
You have to start somewhere. For the ATM example, start with the customer role. What
are the actions for the customer role? Brainstorming could lead to the following use
cases for a customer: