mp343 spring 95 library ooa example

advertisement
Library System
Object Specification
1. Introduction
1.1 Purpose
The Library System will assist borrowers, librarians and the department in using, operating and tracking the
usage within the departments library. Specific features include:
 maintain a catalog of all media items to assist locating information
 maintain a log of checked-out media items for a borrower and for a media topic
 maintain a history of media checked-in and out, per media topic and borrower
 produce late notifications and track fines for over-due media
2. System Description
2.1 Subsystems
The Library System is made up of three subsystems; Media (currently Books, Software and Video Tapes),
Borrowers (currently Faculty Members and Students) and Fines (refer to Figure 2-1).
Library Package
Media
Borrowers
Fines
Figure 2-1 - Library System View
2.1.1 Media Subsystem
The Media Subsystem (figure 2-2) keeps track of the media topics and copies in the library
through a card catalog. The card catalog is made up of media topics specialized into books,
software and video tapes. These topics have zero to many copies that can be checked out by
borrowers of the library.
C
a
r
d
C
a
t
a
l
o
g
C
a
r
d
C
a
t
a
l
o
g
W
i
n
d
o
w
C
a
r
d
C
a
t
a
l
o
g
A
d
d
(
t
o
p
i
c
)
R
e
m
o
v
e
(
t
o
p
i
c
)
F
i
n
d
(
t
o
p
i
c
)
H
o
w
M
a
n
y
O
u
t
(
)
0
.
.
*
M
e
d
i
a
T
o
p
i
c
M
e
d
i
a
C
o
p
y
T
i
t
l
e
A
u
t
h
o
r
D
e
s
c
r
i
p
t
i
o
n
i
s
A
v
a
i
l
a
b
l
e
(
)
0
.
.
*
C
h
e
c
k
o
u
t
(
)
C
h
e
c
c
k
i
n
(
)
A
d
d
C
o
p
y
(
)
B
o
o
k
P
a
g
e
s
S
o
f
t
w
a
r
e
F
o
r
m
a
t
V
e
r
s
i
o
n
V
i
d
e
o
T
a
p
e
F
o
r
m
a
t
R
a
t
i
n
g
Figure 2-2 - Media Subsystem
Examples, Page 1
v990523
OOA
Jim Stafford
Library System
Object Specification
2.1.2 Borrowers Subsystem
The Borrowers Subsystem (figure 2-3) tracks borrowers and their checking out and checking in of
media copies. Only members of the department are allowed to be borrowers in the library. The
borrower’s current and history of checked out media copies is retained. The borrower may
checkout more than one copy at a time. However, each copy may be turned in separately.
B
o
r
r
o
w
e
r
R
e
c
o
r
d
s
A
d
d
(
b
o
r
r
o
w
e
r
)
R
e
m
o
v
e
(
b
o
r
r
o
w
e
r
)
F
i
n
d
(
b
o
r
r
o
w
e
r
)
0
.
.
*
C
h
e
c
k
o
u
t
B
o
r
r
o
w
e
r
A
n
y
O
u
t
(
)
0
.
.
*
A
n
y
O
v
e
r
d
u
e
(
)
C
h
e
c
k
o
u
t
(
)0
.
.
1
I
s
V
a
l
i
d
(
)
P
e
r
s
o
n
N
a
m
e
A
d
d
r
e
s
s
P
h
o
n
e
N
u
m
b
e
r
1
.
.
*
C
h
e
c
k
o
u
t
I
t
e
m
I
s
O
u
t
(
)
I
s
O
v
e
r
d
u
e
(
)
C
h
e
c
k
o
u
t
W
i
n
d
o
w
B
o
r
r
o
w
e
r
R
e
c
o
r
d
s
C
a
r
d
C
a
t
a
l
o
g
0
.
.
1
C
h
e
c
k
i
n
C
h
e
c
k
i
n
W
i
n
d
o
w
C
a
r
d
C
a
t
a
l
o
g
D
a
t
e
Figure 2-3 - Borrowers Subsystem
2.1.3 Fines Subsystem
The Fines Subsystem (figure 2-4) tracks overdue notices, fines and payments made by the
borrower. A borrower is sent one or more overdue notices for a checked out item. The borrower
may not borrow any additional media until the item(s) are returned. After another period of time,
the borrower will be issued a fine for the overdue checked out item. The fine will continue to
increase until the media is returned. The borrower may pay the fine all at once or possibly make
the payment in installments.
F
i
n
e
O
v
e
r
d
u
e
N
o
t
i
c
e D
a
t
e
D
a
t
e
I
s
s
u
e
(
)
P
a
y
m
e
n
t
A
m
o
u
n
t
D
a
t
e
A
m
o
u
n
t
0
.
.
*
0
.
.
*
I
s
s
u
e
(
)
P
a
y
(
)
Figure 2-4 - Fines Subsystem
2.2 Classes
The following is a summary of the purpose for each of the classes listed in the Library System.
 Book - a type of media in the library.
 Borrower - someone who checks out/in media from/to the library.
 Borrower Records - a record of all borrowers in the system.
Examples, Page 2
v990523
OOA
Jim Stafford
Library System
Object Specification














Card Catalog - used to hold and locate media topics.
Card Catalog Window - used to browse the library for media topics and the availability of copies.
Checkin Window - window used to checkin media copy(ies) from a borrower.
Checkout - a record of a set of media checked out by a borrower.
Checkout Window - window used to checkout media copy(ies) to a borrower.
Checkout Item - a detailed record of an individual piece of media checked out/in by a borrower.
Department - interface to validate whether potential borrower is member.
Fine - a running balance of the money due for an overdue media copy.
Media Copy - an individual copy of a media topic. It is what the borrower actually checks out.
Media Topic - a generalization of all types of media that can be in the library.
Overdue Notice - a notification sent to the borrower that informs them of a media copy past-due.
Payment - a record of payment for an overdue media copy.
Software - a type of media in the library.
Video Tape - a type of media in the library.
Examples, Page 3
v990523
OOA
Jim Stafford
Library System
Object Specification
2.3 Use Cases
The system has interfaces with the librarian, browsers and the department. The librarian will perform all
updates to the system. The browsers can locate media. The department will be used to validate new
borrowers added to the system. Figure 2-5 shows the breakdown of functionality between the interfaces.
The breakdown is done in terms of “use cases”. A use case describes actions performed by the system based
on user stimulus and in terms of what the user will see. It forms a “black box”/system view of the library
that will be used to verify we are building the correct system. The following sections detail the primary and
alternate paths of each use case. A primary path is one that we feel is the common occurrence or “norm”.
Alternate paths can be alternate ways of performing the functionality or may cover possible error conditions
not addressed by the primary path. The use cases are supplied in alphabetical order.
Issue Late Notices
<<extends>>
Add Borrowers
<<extends>>
External Librarian
Update Borrowers
<<extends>>
<<extends>>
Remove Borrowers
<<extends>>
Credit Payments
Checkout Media
<<extends>>
Checkin Media
<<extends>>
<<extends>>
Update Media
<<uses>>
External Browser
<<extends>>
Locate Media
Add Media
Remove Media
Figure 2-5 - Library Uses Case Diagram
2.3.1 Use Case: Add Borrowers
Primary Path: Add a Valid New Borrower
The department member will request membership to the library to the librarian. The librarian
obtains their identification information and enters it into the system. The system verifies that the
person 1) has not already been added to the library and 2) is a member of the department. Upon
successful verification, the system creates a permanent record for the borrower transactions. The
borrower is now in the system and may checkout media until they are removed from the
department.
Alternate Path: Attempt to Add non-Department Member
The system reports to the librarian that the person is not a member of the department and cannot be
added to the system. The librarian checks the information again, edits any errors in the data entry
and re-submits the request.
Examples, Page 4
v990523
OOA
Jim Stafford
Library System
Object Specification
Alternate Path: Attempt to Add Duplicate Borrower
The system reports to the librarian that the person is already registered in the library. The librarian
informs the department member that they have already been entered into the system and that they
can begin to checkout media.
2.3.2 Use Case: Add Media
Primary Path: Add New Media Topic
The librarian brings up the card catalog display and enters in the key information for the media
topic, description and any type specific data. The media topic can be a book, software or video
tape. The librarian adds the topic to the system. It is verified that the information is a new media
topic and inserted into the card catalog. The librarian updates the topic with any additional
information and saves the changes.
Alternate Path: Add New Media Copy
The librarian searches for an existing topic in the library. Once located, the librarian can add new
copies to it by supplying copy information. The changes are saved and each new copy is made
available for checkout.
2.3.3 Use Case: Checkout Media
Primary Path: Valid Borrower, With No-Fines, Checks Out Media
The borrower brings the media to the librarian for checkout. The librarian requests their
identification information and searches for them in the system The borrower is found in the system
and verified to still be a member of the department. The borrower is also checked for overdue
books or fines due. Once validated, the librarian begins checking out the selected media to the
borrower. the media copy information is entered into the system and checked out to the borrower.
With each copy, the borrower is re-checked to see if they have exceeded any borrowing thresholds.
Faculty Members can borrower an unlimited number of items. Students will be restricted to some
pre-set limit.
Alternate Path: Valid Borrower Attempts to Checkout more than Maximum
The valid borrower exceeds their maximum amount of checked-out media during a checkout of
new media. The borrower may select which of the items they still wish to checkout and return the
rest of the items to the librarian.
Alternate Path: Attempt to Borrow with Overdue Media
The valid borrower is found to have overdue media or fines due. The system rejects their request to
checkout additional media until the overdue media has been returned and any fines completely
paid.
Alternate Path: Attempt to Borrow after Leaving Department
The system determines that the borrower no longer is a member of the department and rejects their
request to checkout additional media. The librarian may query the system for any outstanding
media still checked-out to the now invalid borrower and attempts to collect any outstanding fines.
2.3.4 Use Case: Checkin Media
Primary Path: Checkin Media On-Time
The librarian obtains the copy information from the media and checks it into the system. The copy
is located in the system and verified to be out, but not overdue. The system also verifies that the
borrower has no other media overdue or fines outstanding.
Alternate Path: Checkin Overdue Media
The system reports the media was overdue and displays the amount of fine due, if any. The
borrower may pay the fine at that time or have their borrowing privileges suspended.
Examples, Page 5
v990523
OOA
Jim Stafford
Library System
Object Specification
2.3.5 Use Case: Credit Payments
Primary Path: Credit Full Payment
The librarian searches for the borrower and credits them with the amount paid. If there is any
problem with the payment, the librarian will be able to again debit the borrowers payment. If the
borrower is “paid in full” and still a member of the department, they may now resume borrowing
media.
Alternate Path: Credit Partial Payment
The librarian enters in the amount of payment. The payment does not cover the total amount of
fines so the borrower is still not allowed to borrow any more media.
2.3.6 Use Case: Issue Late Notices
Primary Path: Issue Late Notice
The librarian requests the system search for overdue media and issue any new notices. Repeat
notices may also be requests after a specified number of days from the original. On the late notice
will be the calculated fine for the borrower.
2.3.7 Use Case: Locate Media
used by: Update Media
interfaces with: External Browser
Primary Path: Browser Locates Media through Display
The browser will search for media topics in the library through a computer display. The topics can
be located by type, title, author, keywords in the description as well as specific media type
selections (ex software format). The results of the search are displayed to the browser in summary
format. The detailed descriptions of each media topic can then be displayed as well as printed.
Alternate Path: Media is not Located for Browser
The system does not locate the media. The browser is informed of this result and can then edit the
previous query or cancel the request.
2.3.8 Use Case: Remove Media
Primary Path: Remove Media Copy
The librarian searches for the media copy and requests that it be removed from the library. The
copy can be “deleted” or “removed”. A librarian would delete a copy only to correct an input error.
The librarian normally removes the copy, allowing a permanent record of its existence to stay in
the library. The librarian must not the reason for removal; lost, destroyed, etc. A copy must not be
checked-out prior to removal/deletion.
Alternate Path: Remove Media Topic
The librarian searches for a media topic and requests that it be removed from the library. This
makes the topic no longer available for browser searches, but copies may still be checked out to
borrowers. The copies will be removed once checked-in.
2.3.9 Use Case: Remove Borrowers
Primary Path: Borrower Leaves Department
The system is informed by the department that a certain person is no longer a member of the
department. The system, searched for outstanding checkouts for the individual and issues notices
for their return. The system will reject any further checkouts by that person.
2.3.10 Use Case: Update Media
Examples, Page 6
v990523
OOA
Jim Stafford
Library System
Object Specification
Primary Path: Update Media
The librarian performs a search for the media and/or media copy. The information is displayed to
their screen and can be updated or printed.
2.3.11 Use Case: Update Borrowers
Primary Path: Update Borrower
The librarian performs a search for the borrower(s). The borrower(s) is/are displayed to their
screen and can be updated or printed.
Examples, Page 7
v990523
OOA
Jim Stafford
Library System
Object Specification
3. Requirements
1.
The system shall provide the capability for a librarian to add as new borrowers.
2.
The system shall verify new borrowers are members of the department.
3.
The system shall prohibit duplicate addition of a borrower.
4.
The system shall recognize a valid borrower as one who a.) is a member of the department, b.)
has no overdue media, owes no fines, and d.) has not exceeded the maximum number of
checked-out items.
5.
The system shall track title, author and description for all media topics.
6.
The system shall consider media topics to be of type books, software and video tapes.
7.
The system shall maintain a perminent record of borrower transactions.
8.
The system shall provide the capability for a librarian to remove borrowers.
9.
The system shall provide the capability to checkout media to a valid borrower.
10. The system shall provide the capability for a librarian to add media topics to the library.
11. The system shall provide the capability for a librarian to add media copies to the library.
12. The system shall provide the capability for a librarian to remove media copies from the
library.
13. The system shall provide the capability for a librarian to remove media topics from the library.
14. The system shall calculate fines due for an overdue checkout item.
15. The system shall provide the capability to determine the total amount due from a borrower.
Examples, Page 8
v990523
OOA
Jim Stafford
Library System
Object Specification
4. Classes and Class&Objects
The following lists the properties for the classes in the library. Each class is listed with their description,
inheritance information and specific responsibilities. Aggregation and association information is described
as an “attribute” of the class. Behaviors is meant to be a generic or summary form of all operations or
methods that must exist for a class. Specific operations or methods will be derived in the actual design of
the class. Trivial/assumed behavior has been left out. For example, assume that all classes can have objects
created from them and destroyed. All classes can have their values set and queried. Also, assume that all
collections can add, remove, and locate items they contain.
4.1 Class: Book
This is a particular type of media in the library. It is used to track topics for all styles of books;
novels, fiction/non-fiction, references, etc.
Parent: Media Topic
Attributes:
Pages - number of printed sides of a page.
Behavior:
Get Summary - provide a one-line summary for catalog displays.
Get Full Description - provide detailed description for card catalog.
Match - locate with aid of wild-cards.
4.2 Class: Borrower
A role played by an individual in our library. This object will be used to model the library-specific
aspects of the person.
Attributes:
Person - borrowers have unique identifying information.
Checkouts - borrowers maintain knowledge of currently checked-out media as well as a
history of all media obtained from the library.
Behavior:
Is Valid - valid borrowers are member of the department and have no overdue media or
outstanding fines.
Match - locate with the aid of wild-cards.
4.3 Class: Borrower Records
A collection of Borrowers. There is only one per library.
Attributes:
Borrowers - tracks all registered borrowers.
4.4 Class: Card Catalog
A collection of media topics providing central knowledge of all contents of the library. There is
only one per library.
Attributes:
Media Topics - maintain a list of all topics and their copies.
4.5 Class: Card Catalog Window
Window used to browse the library for media topics and the availability of copies.
Attributes:
Card Catalog - connects user with library database of media topics/copies.
Behavior
Manage Media Topics - display, print, add, edit, remove media topics
Manage Media Copies - display, print, add, edit, remove media copies
4.6 Class: Checkin Window
Window used to checkin media copy(ies) from a borrower.
Attributes:
Card Catalog - checks media copies into the library
Examples, Page 9
v990523
OOA
Jim Stafford
Library System
Object Specification
Behavior:
Checkin - Checks in the media copy, credits the borrower for the return and determines if any
fines are due.
4.7 Class: Checkout
A record of a set (collection) of media checked out by a borrower.
Attributes:
Date - media is checked-out on a particular date. This is used to determine the due date.
Borrower - media copies are checked out to a single responsible borrower.
Checkout Items - each media copy is individually tracked within a checkout since they can be
individually checked back into the library.
Behavior:
Any Out - determine if any of the associated media copies checked out are still out.
Any Overdue - determine if any of the associated media copies checked out are overdue.
4.8 Class: Checkout Window
Window used to checkout media copy(ies) to a borrower.
Attributes:
Borrowers - used to locate and validate borrower checking out media.
Card Catalog - used to locate and check-out media copies to the borrower.
Behavior:
Checkout - Locates the borrower and media copy to be checked out. Validates the borrower
and checks-out the media copy to that borrower, if they are still valid.
4.9 Class: Checkout Item
A detailed record of an individual piece of media checked out/in by a borrower.
Attributes:
Media Copy - each checkout of a media copy is tracked
Checkin - the record whether the item is still out or has been checked-in.
Checkout - container of all common information relating to the items checked out at one time.
Behavior:
Checkout - add a checkout to the media copy.
Checkin - record the fact that the copy has been checked-in and determine any fines due.
Is Overdue - know when/if copy is due/overdue.
Is Out - know if copy still out.
Fines Due - determine what fines where due for a checked-out media copy.
4.10 Class: Department
Interface to validate whether potential borrower is member.
Attributes:
Members - knows all members of the department.
Behavior:
Is Member - determines whether individual is member of department.
4.11 Class: Fine
A running balance of the money due for an overdue media copy.
Attributes:
Amount Due - total amount of fines due from borrower.
Payments - payments made by borrower.
Checkout Items - items with associated fines.
Borrower - responsible party for paying the fine.
Behavior:
Assess Borrower - borrower is assessed a fine for overdue media.
Make Payment - credit a borrower for payment of fine.
4.12 Class: Media Copy
Examples, Page 10
v990523
OOA
Jim Stafford
Library System
Object Specification
An individual copy of a media topic. It is what the borrower actually checks out.
Attributes:
Media Topic - copies share common topical information with other copies.
Checkouts - checkouts are tracked. There can, at most, be one current checkout.
Behavior:
Checkout - checkout a media copy to borrower.
Is Available - know whether copy is available for checkout.
Is Due - know whether copy has hit its checkout time limit.
Match - locate copies within the library.
4.13 Class: Media Topic
A generalization of all types of media that can be in the library. It forms a collective description of
all copies available for that topic.
Attributes:
Title - official name of topic.
Author - who actually wrote the topic.
Description - a short narrative summary of the contents.
Copies - known copies of the topic.
Behavior:
Add Copy - copies can be added, removed and located for a media topic.
How Many Available - know how many copies are available for checkout.
Get Summary - provide a one-line summary for catalog displays.
Get Full Description - provide detailed description for card catalog.
Match - locate with aid of wild-cards.
4.14 Class: Overdue Notice
A notification sent to the borrower that informs them of a media copy past-due.
4.15 Class: Payment
A record of payment for an overdue media copy.
Attributes:
Amount - amount of payment.
Method - currently only accept cash or check.
4.16 Class: Software
A type of media in the library.
Parent: Media Topic
Attributes:
Version - number of printed sides of a page.
Format - hardware format.
Behavior:
Get Summary - provide a one-line summary for catalog displays.
Get Full Description - provide detailed description for card catalog.
Match - locate with aid of wild-cards.
4.17 Class: Video Tape
A type of media in the library.
Parent: Media Topic
Attributes:
Rating - target audience.
Format - VHS, Beta, etc.
Behavior:
Get Summary - provide a one-line summary for catalog displays.
Get Full Description - provide detailed description for card catalog.
Match - locate with aid of wild-cards.
Examples, Page 11
v990523
OOA
Jim Stafford
Library System
Object Specification
5. Scenarios
This section will break down several of the use-cases into the identified classes and the interactions between
them. Each scenario is an “Event Trace”. An event trace shows an object as a vertical bar with the name of
its class as the top. Connecting the objects are events (horizontal arrows). These are not function calls or
OO-methods. They could map to one or more method calls during design/implementation. However, at this
level of detail, they are just considered “signals” to the object. Trivial requests for information have an
assumed return event with the requested value. Optional returns are shown with an event to provide a
detailed view of what is returned.
5.1 Scenario: Add New Media Topic
The librarian will add a new book to the library by creating a new book media topic through a card catalog
window. In creating the media copy (book), the librarian will supply parameters of title, description, author,
and pages. The librarian will then add a new media copy for each copy of the book (refer to Add New
Media Copy).
External
Librarian
Card Catalog
Window
Card Catalog
Book
Add New Topic
Add New Topic
Create
Add Complete
Add Complete
5.2 Scenario: Add New Media Copy
The librarian will have located the media topic for addition. The librarian will then create a copy containing
the copy number. The copy is added to the topic for available checkout.
Card Catalog
Window
External
Librarian
Card Catalog
Media Copy
Book
Create
Add New Copy
Locate Media
Topic
Add Copy
Add Copy Complete
5.3 Scenario: Locate Borrower
Valid borrowers are maintained in a database by the librarian. A borrower may be located by name or any
other TBD identification information. The searcher provides the criteria to the collection. Each member is
queried for a match. Only matching members are returned.
Borrower
Records
not the one:
Borrower
the one:
Borrower
Locate(Name)
Is Match(Name)
Not A Match
Is Match(Name)
Is A Match
Borrower Found
Examples, Page 12
v990523
OOA
Jim Stafford
Library System
Object Specification
5.4 Scenario: Check-In Media with no Fines Due
The librarian enters the media copy information into the system using the check-in window. The media copy
is located in the card catalog database and checked-in. The checked-in copy is then checked for any fines
due.
Checkin
External
Card Catalog
Window
Librarian
Checkin
Media Copy
Checkout Item
Checkin
Locate(topic,copy)
Create
Checkin
Checkin
Any Fines Due?
Checkin
Complete,
No Fines Due
5.5 Scenario: Locate Media Topic
The media topics can be located through a series of complicated search criterias. The user specify the
search parameters for a particular media topic. The contents of the card catalog are searched and the user is
returned a list of matching media topics that can be selected.
search criteria:
Card Catalog
Media Topic
not the one:
the one:
Media Topic
Media Topic
Create
Locate(criteria)
Is Match(topic)
Get Data
Not A Match
Is Match(topic)
Get Data
Is A Match
Topic Located
Examples, Page 13
v990523
OOA
Jim Stafford
Library System
Object Specification
5.6 Scenario: Validate Borrower
The borrower is checked to see if they are still a member of the department, searched for overdue media
copies and any unpaid fines. The department validates that the person is a member of the department. The
checkouts search over all their associated checkout items for overdue status. The individual checkout items
will know if they are still out and, if out, collaborate with their media copy to determine if they are overdue.
Department
Borrower
Checkout
Checkout Item
Checkout Item
Fin e
Is Valid?
Is Member?
Is A Member
Any Overdue?
Is Overdue?
Is Overdue?
Nothing Overdue
Amount Due?
Nothing Owed
Borrower Is Valid
5.7 Scenario: Valid Borrower Checks-out Valid Amount of Media
The librarian begins a check-out by entering the borrower's identification information and media copy info
through the check-out window. The borrower is located and verified to be valid. The media copy is also
located. The checkout window then adds each item to the borrowers checkout. The borrower is checked for
each item to determine if they over their borrow limit. They are not over the limit, so the copy is checked
out to them.
Borrowe r
Re cord s
Ch eckou t
Win do w
Ext ern al
L ib raria n
Borrowe r
Ca rd Cat alog
Ch eckou t I tem
Ch eckou t
Me dia Cop y
Ch eckou t
L ocat e Borrow er
L ocat e C op y
Cre at e
Add Che ckou t
Is Valid?
Add Ite m(me dia cop y)
Ca n Borrow ?
Cre at e
Ch eckou t
Examples, Page 14
v990523
OOA
Jim Stafford
Download