|

Library Phase 1– Windows Front-End Application
Objective
A database has been created to support the principal
functions of a lending library’s day-to-day operations: adding new members (adult
and juvenile) and checking books in and out. An assembly has been created that contains
classes and interfaces that provide access to the database for these functions.
What is needed is a Windows Forms-based front-end application that will provide
a librarian with a visual interface through which he or she may perform the desired
functions. Creating that application will be your task.
Requirements
• Design and develop a front end application that satisfies
the four basic functionalities: Add Adult, Add Juvenile, Check In a book, Check
Out a book.
• Develop code that is easily maintainable.
• Provide validation for all required fields (see details
below).
• Provide adequate error handling.
• Produce a user interface that is intuitive, requiring
minimal training for users while minimizing resource utilization.
Provisions
• Database scripts are provided in order to create
the Library database (see APPENDIX A).
• An interface that specifies the methods supported
by the Data Access tier used for all database access and a class that implements
the interface are provided. Classes that represent various “business entities” (e.g.,
an AdultMember class) are also provided. Detailed information appears in Appendix
B.
• A reference implementation that illustrates one possible
solution for this project is provided. The reference implementation is not intended
as a model to be emulated in your solution; rather, it serves only to illustrate
how you might implement your solution, rather than how you must implement your solution.
If you wish to use the reference implementation as a basis for how your implementation
will appear and function, you are free to do so, but you are not obligated to replicate
the appearance of the reference implementation.
Validation
• First name, Last name must be non-empty strings consisting
of alphabetic characters only, with a leading uppercase character and all others
in lowercase, at most fifteen characters in length.
• Middle initial is optional, but if entered it must
be one uppercase alphabetic character.
• Street address and city must be non-empty strings,
no more than fifteen characters in length each.
• State must be two uppercase alphabetic characters.
• Zip must be a non-empty string in the format: #####
or #####-####, where # is a digit (0-9).
• Phone is optional, but if entered it must be in the
format: (###)###-####.
• For a juvenile member, birth date must be a valid
date (MM/DD/YYYY format), and the birth date must fall within the eighteen-year
period ending on the current date.
• ISBN, Copy number, and Member ID must be positive
integer values (>0). ISBN must be a 32-bit integer value. Copy number and Member
ID must be 16-bit integer values.
Overview of Library Operations
Before a database to support library operations was
implemented, an interview was conducted with the librarians who would be performing
these operations using the new application. The following sections describe the
considerations that influenced the design and implementation of the database.
Uniquely Identifying Books
Some books may have the same title; therefore, titles
cannot be used as the sole means of identification. Librarians call books items.
Items are identified by the International Standard Book Number (ISBN). Books with
the same title can have different ISBN numbers if they are in different languages
and have different bindings (hard cover or soft cover). Multiple copies of a given
item may be held in the library’s collection. Copies of a given item are numbered
with copy numbers from 1 through n, where n is the number of copies of that item.
A physical item is thus uniquely identified by the pairing of its ISBN and its copy
number.
Enrolling Members
To become a library member, an individual must provide
his or her mailing address and, optionally, his or her phone number. A librarian
then issues the individual a numbered, machine-readable card. This card is good
for one year from the date of issue.
Juveniles are considered to be individuals under the
age of eighteen. A juvenile can be a member of the library, but must have an adult
member sign for them when they join. The juvenile’s address and phone number information
is that of the sponsoring adult member, and the juvenile’s card is valid only until
the sponsoring adult member's card expires. The only information that the library
keeps on a juvenile member is his or her name, sponsoring adult member card number,
and his or her date of birth.
Checking Out Books
Books are checked out for 14 days. Members are allowed
to have at most four books checked out at a time. Members bring books to the front
desk after they locate the ones that they want to check out. A librarian then enters
the card number from the member's card. A screen displays information about the
member's account, such as name, address, phone number, and the card's expiration
date. Ideally, cards that have expired will be highlighted. The screen also displays
information about a member's outstanding loans, including title, checkout date,
and due date.
If a member's account is in order (i.e., the card is
not expired and fewer than four books are on loan to the member currently), a librarian
checks out the books. Librarians check out books by entering the ISBN and copy number
of the item, both of which appear in a label on the book’s spine. The ISBN, copy
number, title, and author information then appear on the computer screen so that
the librarian may verify that the database entry corresponds to the item being checked
out. The librarian then can elect to check the book out or to cancel the check-out
operation.
Occasionally, books are accidentally re-shelved before
librarians check them in. If a librarian tries to check out a book that the database
lists as already checked out, the librarian should be alerted and be given the opportunity
to check the book in before proceeding with the check-out operation.
Checking In Books
When a book is returned to the library, a librarian
checks it in by entering the ISBN and copy number that appears on the book’s spine.
The ISBN, copy number, title, and author information then appear on the computer
screen, as well as the card number and name of the member to whom the book is checked
out, and the book's due date. The librarian can then elect to check the book in
or to cancel the check-in operation.
Data Validation
To enroll an adult member, the required fields are:
• First name
• Last name
• Street
• City
• State
• Zipcode
Middle initial and phone number are optional fields.
To enroll a juvenile member, the required fields are:
• First name
• Last name
• Adult member ID
• Birthday
Middle initial is an optional field.
First name and last name fields must be validated to
ensure that the values contained in these fields are alphabetic only and that the
first character of each of these fields is uppercase.
The Zipcode field must be validated to ensure that
only a five-digit (XXXXX) or a nine-digit (XXXXX-XXXX) value is entered.
If a value is entered into the middle initial field,
that field must be validated to ensure that the value entered is a single alphabetic
character.
If a value is entered into the phone number field,
that field must be validated to ensure that the value conforms to the format (XXX)XXX-XXXX,
where X is a digit from 0 through 9. Note there is no space after the right parenthesis;
the field in the database for the phone number is thirteen characters long, so including
a space at this point would cause the phone number to be truncated.
The adult member ID field must be validated to ensure
that it contains only a numeric value in the range 1 through 32767 inclusive.
The birthday field must be validated to ensure that
it contains a value in the format MM/DD/YYYY and that the value parses to a date
that is no more than eighteen years prior to the current date.
When a member ID is entered to perform a member lookup,
that field must be validated according to the same rule specified for the adult
member ID field above.
For the ISBN and copy number fields used in the check-in
and check-out operations, these fields must be validated to ensure that only numeric
values are entered. For the copy number field, the value must be in the range 1
through 32767 inclusive.
Suggested Project
Techniques
• Use menus instead of buttons to free screen space,
when appropriate.
• Use combo boxes (drop-down lists) and list boxes
instead of free-form textboxes for data entry whenever possible.
• Avoid overuse of message boxes and other modal communications
to the user. Use other display techniques such as a status bar or a label.
• Use standard naming conventions to provide code readability.
• Make use of collections to produce concise code.
• While calls into the data access class’s methods
by the presentation tier (i.e., by the code in your Form’s event handlers) are permitted,
you might want to consider creating a middle tier for mediating between your presentation
tier and the data access tier. Using a middle tier can simplify the code in your
presentation tier considerably.
|