面向对象分析与设计实例 Object Oriented Analysis and Design--Library System

Lab1

Problem Statement

The library receives applications from people who want to become library members, whom we alternatively refer to as users. While applying for membership, a person supplies his/her name, phone number and address to the library. The library assigns each member a unique identifier(ID), which is needed for transactions such as issuing books.

We will make the assumption that the collection includes just books. For each book the library stores the title, the author’s name, and a unique ID. (For simplicity, let us assume that there is only one author per book. If there are multiple authors, let us say that the names will have to be concatenated to get a pretty huge name such as ‘Brahma Dathan and Sarnath Ramnath.’ As a result,to the system, it appears that there is just one author.)

When it is added to the collection, a book is given a unique identifier by the clerk.This ID is based on some standard system of classification.

Issue a book to a member(or user) To check out books, a user (or member) must identify himself to a clerk and hand over the books. The library remembers that the books have been checked out to the member. Any number of books may be checked out in a single transaction.

To return a book, the member gives the book to a clerk, who submits the information to the system, which marks the book as ‘not checked out’. If there is a hold on the book, the system should remind the clerk to set the book aside so that the hold can be processed.

From time to time, the library may remove books from its collection. This could be because the books are worn-out, are no longer of interest to the users, or other sundry reasons.

Print out the interactions (book checkouts, returns, etc.) between a specific user and the library on a certain date.

When a user wants to put a hold, he/she supplies the clerk with the book’s ID, the user’s ID, and the number of days after which the book is not needed. The clerk then adds the user to a list of users who wish to borrow the book. If the book is not checked out, a hold cannot be placed. To remove a hold,the user provides the book’s ID and the user’s ID.

Customers may walk in and request that several of the books they have checked out be renewed (re-issued). The system must display the relevant books, allow the user to make a selection, and inform the user of the result.

Customers who had placed a hold on a book are notified when the book is returned. This process is done once at the end of each day. The clerk enters the ID for each book that was set aside, and the system returns the name and phone number of the user who is next in line to get the book.

In addition, the system must support three other requirements that are not directly related
to the workings of a library, but, nonetheless, are essential.
• A command to save the data on a long-term basis.
• A command to load data from a long-term storage device.
• A command to quit the application. At this time, the system must ask the user if data
is to be saved before termination.

Book Managment System Glossary

Introduction

This document is used to define terminology specific to the problem domain, explaining terms, which may be unfamiliar to the reader of the use-case descriptions or other project documents. Often, this document can be used as an informal data dictionary, capturing data definitions so that use-case descriptions and other project documents can focus on what the system must do with the information.

Definitions

The glossary contains the working definitions for the key concepts in the Book Management System.

1.User
Someone who can borrow and return books from the library.
2.Library
The foundation of the operation of Book Management System.
3.Collection
Where all the books are kept.
4.Clerk
The operator of the library management system.
5.Transaction
All operations of members in the library.
6.Hole
A claim for a book before borrowing it.
7.Record
Marks the current state of the book.
8.long-term storage device
Where data is kept for the long term.
9.Command
The operation of a storage device.

Lab2

在这里插入图片描述

1.Add Member

1.1Brief Description
This use case describes how librarians register new members.

1.2Flow of Events
1.21 Basic Flow
This use case begins when the librarian needs to add new members to the system.
1.Librarians issue instructions to the system to apply for new members.
2.The system ask for data of new members.
3.The clerk enters the data which contains customer name, address and telephone number into the system.
4.The system reads the data, generates an identification number for the member if it can be added, and remembers the information about the member. If a member is added, the employee is notified and the name, address, phone number and ID of the member are output.
5.The clerk gave the user his ID number.
1.22 Alternative Flows
None.

1.3Special Requirements
None.
1.4Pre-Conditions
None.
1.5Post-Conditions
If the use case succeeds, new members are added to the system. If not, the system state remains unchanged.
1.6 Extension Points
None.

2. Add Book

1.1 Brief Description
This use case describes how librarians add books to the library management system.

1.2 Flow of Events
1.21 Basic Flow
This use case begins when the library receives a shipment of books from the publisher.

  1. The clerk issuers a request to add a new book.
  2. The system ask for the identifier, title and author’s name of book.
  3. The clerk generates the unique identifier, enters the identifier, title, and author name of a book.
  4. The system attempts to enter the information in the catalog and echoes to the clerk the title, author name, and id of the book. It then asks if the clerk wants to enter information about another book.
  5. The clerk answers in the affirmative or in the negative.
  6. If the answer is in the affirmative, the system goes to Step 3. Otherwise, it exits.
    1.22 Alternative Flows
    None.

1.3 Special Requirements
None.
1.4 Pre-Conditions
None.

1.5 Post-Conditions
None.

1.6 Extension Points
None.

3. Issue Book

1.1 Brief Description
This use case is used for issuing books.

1.2 Flow of Events
1.21 Basic Flow
This user case begins when the member arrives at the check-out counter with a set of books and supplies the clerk with his/her identification number.
1.The clerk issues a request to check out books.
2.The system asks for the user id.
3.The clerk inputs the user ID to the system.
4.The system asks for the ID of the book.
5.The clerk inputs the ID of a book that the user wants to check out.
6.The system records the book as having been issued to the member; it also records the member as having possession of the book. It generates a due-date. The system displays the book title and due-date and asks if there are any more books.
7.The clerk stamps the due-date on the book and replies in the affirmative or negative.
8.If there are more books, the system moves to Step 5; otherwise it exits.
1.22 Alternative Flows
None.

1.3 Special Requirements
1.4 Pre-Conditions
1.5 Post-Conditions
The customer collects the books and leaves the counter.

1.6Extension Points
None.

4. Return Book

1.1 Brief Description
This use case is used to return books.

1.2 Flow of Events
1.21 Basic Flow
This use case begins when users return books by leaving them on a library clerk`s desk.
1.The clerk issues a request to return books.
2.The system asks for the identifier of the book.
3.The clerk enters the book identifier.
4.If the identifier is valid, the system marks that the book has been returned and informs the clerk if there is a hold placed on the book; otherwise it notifies the clerk that the identifier is not valid. It then asks if the clerk wants to process the return of another book.
5.The clerk answers in the affirmative or in the negative and sets the book aside in case there is a hold on the book.
6.If the answer is in the affirmative, the system goes to Step 3. Otherwise, it exits.
1.22 Alternative Flows
None.

1.3 Special Requirements
None.
1.4 Pre-Conditions
None.
1.5 Post-Conditions
None.
1.6 Extension Points
None.

5. Print Transaction

1.1 Brief Description
This use case is used to print transactions from the system.

1.2 Flow of Events
1.21Basic Flow
1.The clerk issues a request to get member transactions.
2.The system asks for the user ID of the member and the date for which the transactions are needed.
3.The clerk enters the identity of the user and the date.
4.If the ID is valid, the system outputs information about all transactions completed by the user on the given date. For each transaction, it shows the type of transaction (book borrowed, book returned or hold placed) and the title of the book.
5.Clerk prints out the transactions and hands them to the user.
1.22 Alternative Flows
None.

1.3 Special Requirements
None.
1.4Pre-Conditions
None.
1.5 Post-Conditions
None.
1.7Extension Points
None.

6. Remove Books

1.1 Brief Description
This use case is used to delete books from the system.
1.2 Flow of Events
1.21 Basic Flow
Librarian identifies the books to be deleted.
1.The clerk issues a request to delete books.
2.The system asks for the identifier of the book.
3.The clerk enters the ID for the book.
4.The system checks if the book can be removed using Rule. If the book can be removed, the system marks the book as no longer in the library’s catalog. The system informs the clerk about the success of the deletion operation. It then asks if the clerk wants to delete another book.
5.The clerk answers in the affirmative or in the negative.
6.If the answer is in the affirmative, the system goes to Step 3. Otherwise, it exits.
1.22 Alternative Flows
None.

1.3 Special Requirements
None.
1.4Pre-Conditions
None.
1.5 Post-Conditions
None.
1.6 Extension Points
None.

7. Place a Hold

1.1 Brief Description
This use case is used to place a hold.
1.2 Flow of Events
1.21Basic Flow
1.The clerk issues a request to place a hold.
2.The system asks for the book’s ID, the ID of the member, and the duration of the hold.
3.The clerk enters the identity of the user, the identity of the book and the duration.
4.The system checks that the user and book identifiers are valid and that Rule 6 is satisfied. If yes, it records that the user has a hold on the book and displays that; otherwise, it outputs an appropriate error message.

1.22 Alternative Flows
None.

1.3 Special Requirements
None.
1.4Pre-Conditions
None.
1.5 Post-Conditions
None.
1.6 Extension Points
None.

8. Remove Hold

1.1 Brief Description
This use case is used to remove hold.
1.2 Flow of Events
1.21Basic Flow
1.The clerk issues a request to remove a hold.
2.The system asks for the book’s ID and the ID of the member.
3.The clerk enters the identity of the user and the identity of the book.
4.The system removes the hold that the user has on the book (if any such hold exists), prints a confirmation and exits.
1.22 Alternative Flows
None.

1.3 Special Requirements
None.
1.4Pre-Conditions
None.
1.5 Post-Conditions
None.
1.6 Extension Points
None.

9. Process Holds

1.1 Brief Description
This use case is used to process holds.
1.2 Flow of Events
1.21 Basic Flow
1.The clerk issues a request to process holds (so that Rule 5 can be satisfied).
2.The system asks for the book’s ID.
3.The clerk enters the ID of the book.
4.The system returns the name and phone number of the first member with an unexpired hold on the book. If all holds have expired, the system responds that there is no hold. The system then asks if there are any more books to be processed.
5.If there is no hold, the book is then shelved back to its designated location in the library. Otherwise, the clerk prints out the information, places it in the book and replies in the affirmative or negative.
6.If the answer is yes, the system goes to Step 2; otherwise it exits.

1.22 Alternative Flows
None.
1.3 Special Requirements
None.
1.4Pre-Conditions
None.
1.5 Post-Conditions
None.
1.6 Extension Points
None.

10. Renew Books

1.1 Brief Description
This use case is used to renew books.
1.2 Flow of Events
1.21 Basic Flow
. Member makes a request to renew several of the books that he/she has currently
checked out.
1.Clerk issues a request to renew books.
2.System asks for the member’s ID.
3.The clerk enters the ID into the system.
4.System checks the member’s record to find out which books the member has checked out. If there are none, the system prints an appropriate message and exits; otherwise it moves to Step 6.
5.The system displays the title of the next book checked out to the member and asks whether the book should be renewed.
6.The clerk replies yes or no.
7.The system attempts to renew the book using Rule 4 and reports the result. If the system has displayed all checked-out books, it reports that and exits; otherwise the system goes to Step 6.
1.22 Alternative Flows
None.

1.3 Special Requirements
None.
1.4Pre-Conditions
None.
1.5 Post-Conditions
None.
1.6 Extension Points
None.

Lab3

1.class diagram

在这里插入图片描述

2.Analytical Category

在这里插入图片描述

Lab4

1.Add Members

在这里插入图片描述

2.Return Books

在这里插入图片描述

3.Place Holds

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值