CPSC 333: Library Information System, Version Two

Location: [CPSC 333] [Ongoing Examples] [Library Information System] Version Two

This page was most recently modified on February 25, 1997


Problem Statement

The system is used to keep track of the books available for loan to card holders. Each book has an ISBN number (and no two books have the same ISBN number). In order to answer queries about the books in the library it is necessary for the system to keep track of the title and author of each book as well. Titles and authors are not generally unique. (Detailed information about authors won't be maintained, so you can assume that the ``author'' for a book will be represented by a short character string.)

The system also stores information about card holders (who are entitled to borrow books from the library). Each card holder has a unique card number, as well as a name (first name, middle initial, and last name), telephone number, and address (first line, second line, city, province, and postal code). Each card holder can have zero or more books out on loan; clearly, a book can be out on loan to at most one card holder at a time. It is not necessary for this system to maintain information about a loan after the book has been returned to the library.

The system can be used a librarian to maintain the information described above, and to produce several reports. In particular, the librarian should be able to supply an ISBN number as input, and receive a report listing the title and author for the corresponding book, as well as its availability (that is, whether it's currently on loan, the card number of the card holder who has it out, and the due date for the loan, if it is). The librarian should also be able to supply a card number and receive a report listing information about the corresponding card holder, including the ISBN numbers of all books that the card holder has on loan, along with their due dates. Finally, the system should automatically generate a set of ``overdue notices'' once a day, for the loans that have just become overdue, as well as a set of ``reminder notices'' for loans that are now overdue by more than one week.


References in Lab Exercises

This system will be considered in several lab exercises.


Requirements Specification - Structured Analysis

Entity-Relationship Diagram

Picture of ERD


Data Dictionary for Entity-Relationship Diagram

Name: author
Kind: At
Type: string
Description: Non-key attribute of Book
Name: Book
Kind: E
Type: @ISBN number + title + author
Description: Represents a book available for or out on loan
Name: Card Holder
Kind: E
Type: @card number + first name + middle initial + last name + telephone number + first line of address + second line of address + city + province + postal code
Description: Represents people who are entitled to borrow books
Name: card number
Kind: At
Type: integer
Description: Key attribute of Card Holder
Name: city
Kind: At
Type: string
Description: Non-key attribute of Card Holder
Name: due date
Kind: At
Type: date
Description: Non-key attribute of Loan
Name: first line of address
Kind: At
Type: string
Description: Non-key attribute of Card Holder
Name: first name
Kind: At
Type: string
Description: Non-key attribute of Card Holder
Name: ISBN number
Kind: At
Type: integer
Description: Key attribute of Book; should be positive and exactly nine digits long
Name: last name
Kind: At
Type: string
Description: Non-key attribute of Card Holder
Name: Loan
Kind: AO - 1c:Mc Single
Type: @ISBN number + card number + due date
Description: Each book can be on loan to at most one card holder, and each card holder can have zero or more books out on loan
Name: middle initial
Kind: At
Type: character
Description: Non-key attribute of Card Holder
Name: postal code
Kind: At
Type: string
Description: Non-key attribute of Card Holder; should have length six. First, third, and fifth characters should be letters; others should be digits
Name: province
Kind: At
Type: [ `British Columbia' | `Alberta' | `Saskatchewan' | `Manitoba' | `Ontario' | `Quebec' | `Newfoundland' | `Nova Scotia' | `Prince Edward Island' | `New Brunswick' | `Yukon Territory' | `Northwest Territories' ]
Description: Non-key attribute of Card Holder
Name: second line of address
Kind: At
Type: string
Description: Non-key attribute of Card Holder
Name: telephone number
Kind: At
Type: integer
Description: Non-key attribute of Card Holder; should be either seven or ten digits long ...
Name: title
Kind: At
Type: string
Description: Non-key attribute of Book

Event List

The following ``events'' might be discovered after reading the problem statement given above and, perhaps, asking some questions of the Librarian who will be using the system.

Event Number: 1
Event Name: New Book is Acquired
Inputs: (Complete) ISBN number, title, author
Outputs: status message
Error Conditions:
  1. Syntactically incorrect inputs
  2. ISBN number is already in use

Note that the ``(Complete) ISBN number'' used in system inputs and outputs will always include a final ``check digit,'' that is actually either a digit between 0 and 9, or the letter `X,' and that represents a ``mod-11 sum'' of the rest of the number. This ``check digit'' wasn't included in the definition of ``ISBN number'' given in the data dictionary for the system's entity-relationship diagram (just to make the point that it represented ``redundant data'').


Event Number: 2
Event Name: Book is Lost or Destroyed
Inputs: (Complete) ISBN number
Outputs: status message
Error Conditions:
  1. Syntactically incorrect input
  2. ISBN number is not in use
  3. Corresponding book is out on loan

Event Number: 3
Event Name: Book Information is Corrected
Inputs: (Complete) ISBN number, title, author
Outputs: status message
Error Conditions:
  1. Syntactically incorrect inputs
  2. ISBN number is not in use

Event Number: 4
Event Name: Librarian Requests Information about Book
Inputs: (Complete) ISBN number
Outputs: book info, status message
Error Conditions:
  1. Syntactically incorrect inputs
  2. ISBN number is not in use

Event Number: 5
Event Name: LIbrary Card is Issued
Inputs: name, address, telephone number
Outputs: card number, status message
Error Conditions:
  1. Syntactically incorrect inputs
Effects: A new card number (larger than any that has been issued before) is generated, and reported to the Librarian for use (and, a new ``card holder'' is created).

Event Number: 6
Event Name: Lending Privileges are Withdrawn
Inputs: card number
Outputs: status message
Error Conditions:
  1. Syntactically incorrect input
  2. Card number is not in use
  3. Corresponding card holder has books out on loan

Event Number: 7
Event Name: Card Holder Information is Corrected
Inputs: card number, name, address, telephone number
Outputs: status message
Error Conditions:
  1. Syntactically incorrect inputs
  2. Card number is not in use

Event Number: 8
Event Name: Librarian Requests Information About Card Holder
Inputs: card number
Outputs: card holder info, status message
Error Conditions:
  1. Syntactically incorrect inputs
  2. Card number is not in use

Event Number: 9
Event Name: Book is Loaned Out
Inputs: (Complete) ISBN number, card number
Outputs: due date, status message
Error Conditions:
  1. Syntactically incorrect input
  2. ISBN number is not in use
  3. Card number is not in use
  4. Corresponding book is already out on loan

Event Number: 10
Event Name: Book is Returned
Inputs: (Complete) ISBN number
Outputs: status message
Error Conditions:
  1. Syntactically incorrect input
  2. ISBN number is not in use
  3. Corresponding book is not out on loan

Event Number: 11
Event Name: Loan is Renewed
Inputs: (Complete) ISBN number
Outputs: due date, status message
Error Conditions:
  1. Syntactically incorrect input
  2. ISBN number is not in use
  3. Corresponding book is not out on loan

Event Number: 12
Event Name: Reminder Notices and Overdue Notices are Required
Inputs: None are required
Outputs: reminder notice, overdue notice (multiple instances of each may be generated)
Error Conditions: None

Location: [CPSC 333] [Ongoing Examples] [Library Information System] [Version Two]


Department of Computer Science
University of Calgary

Office: (403) 220-5073
Fax: (403) 284-4707

eberly@cpsc.ucalgary.ca