The Use Case view

Before we attempt to answer the question from the previous page, let’s see the use case text (we will detail what a “use case” is in a short while).  The context in which this is written is that there is some kind of system that allows the librarian to check the details of the book and the card holder.

Use case: borrow book

  1. Card makes a request to borrow a book
  2. The librarian responds by asking them for their membership card and the book they wish to borrow
  3. Card presents the book and their membership card to the librarian
  4. The librarian verifies that book may be lent out and the card holders membership using their membership card
  5. The librarian stamps the book with the return date and passed back to the card holder their membership card the book
  6. Card holder leaves with the book

Is the actor the librarian because they operate the computer systems?  Well let’s look at some interesting changes in how we use a number of services; booking a seat on a plane and purchasing goods at a supermarket.

  1. In the past (pre internet) if you wanted to book a seat at the theatre, a concert, hire a car or book a seat on a plane, you would have had to speak to an operator at an agency.  With the advent of the internet what has changed?  You still have to surrender the same information and get the same results, but the middleman (the agent) has gone.  So who was the actor, the agent or the customer in the use case “reserve/book...”?  Were the agents ever the actor?
  2. In the past (maybe before 2002) if you went to a supermarket, you would present your selected items to a clerk at a checkout till, they would total up the goods and you would pay.  Now many supermarkets allow shoppers to total up the goods themselves and then pay at an automated teller unit.  So who was the actor, the teller or the shopper???

In both of these examples, if you were to focus on the teller or the agent, the interactions between the system and the actor would look very different to that of the system and the customer. 

Actors are not the things that press the buttons, but those things that interact with the system, consume form or produce information for the system and something that the system has no control over.

So let’s go back to our library example, is the actor the card holder or the librarian.  The truth is, it depends on the use case.  There is a symbiotic relationship between the actors and the use cases that they are associated with.  In this example for the “borrow book” use case, the actor has to be the “card holder” for all the reasons given in the two examples above.  If the “card holder” walks away when the card or book are requested, does the librarian have any control over them?  If the “card holder” doesn’t surrender their card or the book when requested, can the use case continue>  On examination we see that the answer to theses questions is NO.  So the system can exhert no control over the “card holder” and without the “card holder” the book would never be borrowed.

      

Use Case Context                                       Use Cases Defined