Flylib.com

Books Software

 
 
 

Use Cases for a Simple Library System

Chapter 3 - Diagramming Business Objects
byAndrew Filevet al. ?
Wrox Press 2002

Team FLY

Use Cases for a Simple Library System

Now that we have defined our business object and data-access base classes, we're ready to look at the use case diagrams we will use to derive our application-specific business objects. In a normal project lifecycle, use cases are created before we begin object modeling. In this chapter, we haven't created any application-specific business objects - just our base classes, so we're still playing by the rules.

Use cases are an extremely important aspect of UML modeling. They allow developers to understand software systems from the user's perspective, and cause the whole system architecture to be driven by what the user wishes to do with the system - which, unfortunately , doesn't often happen!

The use cases in our example describe a simple software application for a library. This example is a variation along the classic theme of use case examples and works well because it's simple enough to model in a chapter this size , but has enough meat on its bones to demonstrate many aspects of the UML. In our simple library system, media is borrowed and returned. Late fees are assessed as follows : Three dollars per day for overdue DVDs, two dollars per day for magazines, and one dollar per day for overdue books. A borrower is not allowed to check out media if they have any overdue media, if they already have five items checked out, or if they have accrued more than fifty dollars in fines .

The following image contains a high-level overview use case diagram containing most of the main use cases in this application:

click to expand

As you can see in this diagram, there are three actors - the Borrower, Librarian, and Accountant. The Borrower (as you might imagine) represents people who borrow media from the library. In our application, media consists of books, magazines, and DVDs. As with most library systems, the only action the Borrower can perform is to search for media.

The Librarian searches for media, but also performs a few additional actions. A Librarian checks in media, checks out media, and applies payments for fines to a Borrower's account. The Accountant performs two main actions. They apply payments to a Borrower's account, as well as run daily processing. This daily processing procedure is run each evening to generate e- mails warning borrowers of unreturned media and overdue fines.

Notice our use case diagram identifies three "uses" relationships, indicating places where application functionality is reused from multiple use cases. Both the Check in Media and Daily Processing use the Calculate Overdue Amount use case. Check Out Media and Apply Payments use the Display Borrower Account use case.

We won't perform object modeling on all these use cases, but we'll pick a few key use cases so you get a feel for how it's done.

Team FLY

Chapter 3 - Diagramming Business Objects
byAndrew Filevet al. ?
Wrox Press 2002

Team FLY

Modeling the Check Out Media Use Case

The first use case we'll model is " Check Out Media ". Here is a more detailed explanation of this use case:

  1. The Librarian enters the Borrower's ID. This is either entered manually or scanned from a library card.

  2. The system responds by displaying the borrower's account. The Display Borrower Account use case is implemented here. Here is the description for this use case:

    The system displays the borrower's account. This information includes the number of items they can borrow , unpaid fines , and a list of media checked out. The "checked out media" list includes due date and special indication for overdue media.

    Here are the business rules for checking out media: the Borrower can only check out items if they have no overdue media, less than five articles checked out, and outstanding fines less than fifty dollars.

  3. The Librarian enters the media ID. This is either entered manually or scanned from the media bar code.

  4. The system responds by marking the media as "checked out". This step can be repeated for the total number of items a borrower can check out.

Team FLY