Tải bản đầy đủ (.docx) (27 trang)

Báo cáo phân tích thiết kế hệ thống quản lý thư viện

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (213.94 KB, 27 trang )

TRƯỜNG ĐẠI HỌC BÁCH KHOA HÀ NÔI
VIỆN CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
BÁO CÁO MÔN HỌC:
PHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG THÔNG TIN
GIẢNG VIÊN: TRẦN ĐỨC KHÁNH
ĐỀ BÀI: PHÂN TÍCH THIẾT KẾ HỆ THỐNG QUẢN LÝ
THƯ VIỆN
Sinh viên thực hiện: Nguyễn Trí Quân.
SHSV : 20092135
Lớp : KTMT & TT 1.
1
I. Phân tích chức năng.
1. System Requirements of Library System
You are working on a new business system for S City Library. The library wants to
systematize book check-out, return, search and reservation as well as usage status
check. Assume that the library has multiple copies of the same books, each of
which is identified by its book number. The library also wants to offer book search,
reservation and usage status check services to the public over the Internet. S City
Library is available to the public from 9:00 to 18:00.
(1) User registration
- To borrow a book, users first create their “borrower’s cards”.
- They fill out the “borrower’s card application form”, and submit the filled form
with their identification (e.g. health insurance card or driver’s license) to the front
counter of the library.
- Internet users can access the library system using their accounts and tentative
passwords that are issued when they register as library users. The tentative
password can be changed at any time.
(2) Using the library system via the Internet
- Users can use the library system via the Internet by entering their accounts and
passwords.
- Library staff enter their employee numbers and passwords. They leverage the


system to perform operations of S City Library. Specifically, they can perform
book search, check-out, return, reservation, user registration and usage status
check.
- General users enter their borrower’s card numbers and passwords. They can
perform book search, usage status check and reservation.
2
(3) Borrowing books
- The system assigns an administration number (check-out number) to each check-
out.
- A user can borrow up to 10 books for 15 days.
- Users bring books they want to borrow, together with their “borrower’s cards”, to
the front counter.
  - Books to be checked out are those that users personally bring from the
shelves in the library to the “front counter” or that users have reserved over the
Internet and library staff have held for them.
  - If a user has any books that are overdue, the user cannot borrow another book.
  - General users can reserve books they want to borrow and borrow the reserved
books. Book reservation will be explained later in this text.
(4) Returning books
- The system processes book return in units of books.
- Users return books to the “return counter” of the library before the due date.
- Users can return books to the “return post” when the library is closed.
- Library staff put the returned books back on the shelves or hold them for users
who have reserved the books.
(5) Searching a book
- The system allows users to search for a book that the library owns.
- Users can search books using keywords such as “title”, “author” and “publisher”.
(6) Reserving books
3
- The library system allows users to “reserve” books that cannot be found for some

reason. For example, the book has been checked out.
- Users cannot reserve books that the library does not own.
- The system processes reservation in units of book titles. (A book number cannot
be specified.)
- The system assigns an administration number (reservation number) to each
reservation.
- A user can reserve up to 10 books (excluding books that had been reserved and
has already been checked out 
- The system does not allow double reservations for the same book.
- When a reserved book is held for the general user, library staff notify the user of
it by phone or e-mail. Users can specify their contact method (phone or e-mail) at
the time of reservation.
- The system allows checking the information on reservation that is made by a
general user.
(7) Checking usage status.
- The library system allows checking the status of the books that a general user has
borrowed or reserved. Usage status check can also be performed over the Internet.
System users can check the usage status on the usage status check screen after
logging on to the library system.
2. Business Analysis.
2.a. Business Activities.
• Log on.
• Searching Book.
• Reserving Book.
• Check Usage Book.
• Register.
4
• Lending Book.
• Returning Book.
2.b. Business Process.

• Log on:
User System
Log on to the system.
Enter user’s name and password.

Check the account.
Inform failure to user
Display the user’s windows.
5
Yes
No
Valid
• Register
User Librarian System
Make a borrower’s
card
Fill out form
card
Create account
Issue inform
Save user account
6
Reserving Book:
User System
Enter BookID

Check book’s status
Inform to user
Change book’s status and save reserving information
Inform to user

7
yes
no
available
• Lending book
User Librarian System
8
Request to borrow book
Take book to librarian
Book
Take book to user.
Enter borrower’s name
Enter BookID of lending books
Check lending condition
Inform to user
Check book’s status
Inform failure
Inform success
Change book status and
borrower profile
3. PHÂN TÍCH CA SỬ DỤNG
3.a.Xác định tác nhân và usecase
9
no
yes
Reserved?
yes
no
yes
no

isValid
isValid
Tác nhân:
• Người dùng
• Thủ thư
UseCase:
• Đăng kí người dùng
• Đặt sách
• Trả sách
• Cho mượn sách
• Tìm sách
• Kiểm tra trạng thái
• Đăng nhập
3.b. Biểu đồ Usecase
3.c. Mô tả các ca sử dụng.
• Log on
10
UseCaseID U001
Name Log on
Summary Log on the library system
Actor A librarian or citizen user
Preconditions The ID and Password have been issued
Description
No Actor
1
An actor enter the following information from the log-on
screen: ID and Password.
2
The system searches for librarian and citizen user
information corresponding to the ID to verify that the

password is correct.
3
If the actor is successfully logged on the “library staff
menu” or “citizen user menu” appears.
Exception
2a
The librarian or citizen user
corresponding to the entered
ID is no found.
2b The entered librarian or citizen users password is wrong.
1a There are some blank fields.
Scenarios Description
U001-#01 The citizen user is successfully logged on.
U001-#02 The librarian is successfully logged on.
U001-#03 The user information corresponding to the ID is not found.
U001-#04 The entered password is wrong.
U001-#05 There are some blank fields.
• Lend book.
UseCaseID U002
11
Name Lend book
Summary Thực hiện chức năng mượn sách của hệ thống
Actor A librarian
Preconditions The librarian đã đăng nhập vào hệ thống
Description
No Actor
1
Tác nhân nhập vào các thông tin “library card number”,
“bookid”, ”reservation number”.
2

Hệ thống tìm kiếm thông tin “library card number” tương
ứng.
3
Hệ thống tìm kiếm sách tương ứng với “bookid”. Nếu
người dùng đặt sách thì tìm kiếm thông tin ứng với
“reservation number”.
4
Hệ thống kiểm tra sách có sẵn hay không. Nếu đặt sách
thì kiểm tra đặt sách có hợp lệ hay không
5
Hệ thống kiểm tra số lượng mượn dưới 10 quyển hay
không
6
Hệ thống kiểm tra người dùng còn sách nào quá hạn hay
không.
7 Hệ thống xác nhận số sách đưa vào hệ thống.
8 Hệ thống thay đổi thông tin trạng thái của sách.
9
Hệ thống tạo thông tin mượn sách và cập nhập vào trong
thư viện các trường: card number, bookid,lending date,
hạn mượn và trạng thái.
10
Hệ thống hiển thị kết quả ra màn hinh:
Thông tin người dùng: “library card number”,
“Name”
Thông tin đưa ra: “lending number”, “lending
date”, “due date”, “bookid”, “title”, “auther”,
“publisher”.
12
Exception

6a
Người dùng đang mượn sách
quá hạn .
5b
Số lượng sách mượn lớn hơn 10 quyển.
4a
Lượng sách trong thư viện không còn đủ để cho mượn.
3a
“bookid” không đúng.
3b
“reservation” không đúng.
2a
“library card number” không đúng.
1a
Một số trường bỏ trống.
Scenarios Description
U002-#01
Người dùng mượn sách thành công
U002-#02
Người dùng vi phạm quy định mượn trả sách
U002-#03
Vượt quá số lượng sách mượn quy định
U002-#04
Thư viện không còn sách để cho mượn
U002-#05
Nhập thông tin “bookid” không chính xác
U002-#06
Nhập thông tin “reservation” không chính xác
U002-#07
Nhập thông tin “library card number” không chính xác

U002-#08
Một vài trường để trắng
• Reserving Book:
UseCase ID U003
Name Đặt sách
Summary Đặt sách trong thư viện
Actor người dùng thư viện
Precondition Người dùng đăng nhập vào hệ thống
Description No. Tác động
1 Người dùng nhập id sách cần đặt
13
2 Hệ thống kiểm tra xem người dùng đã đặt quá 10
cuốn chưa
3 Hệ thống kiểm tra xem sách đó đã đặt trước bởi
người dùng chưa
4 Hệ thống ấn định 1 mã số đặt sách nếu sách được
đặt thành công
5 Hệ thống có thể gửi mail đến người đặt nếu người
đặt yêu cầu báo đặt thành công bằng việc gửi mail.
1a Các ô cần nhập để trống
Exception 2a Số sách dặt quá 10 cuốn báo lại lên màn hinh
3a Sách đã được đặt trước rồi báo lại lên màn hình
Scenarios Mô tả
U003 - #01 Đặt được sách, hệ thống thông báo thành công
U003 - #02 Gửi mail về cho người đặt báo thành công
U003 - #03 Các ô cần nhập còn để trống
U003 - #04 Số sách người dùng đã đặt quá 10
U003 - #05 Sách người dùng đã đặt trước rồi
UseCaseID U004
Name Tìm sách

Summary Tìm kiếm các sách có trong hệ thống
14
Actor Người dùng và người quản lí thư viện
Preconditio
n
Người dùng đã đăng nhập thành công vào hệ thống
Description 1. Người dùng chọn từ khóa để tìm sách và nhập vào từ khóa cần
tìm kiếm
2. Hệ thống kiểm tra sự tồn tại của sách theo từ khóa
3. Khi hệ thống tìm thấy sách theo từ khóa, kiểm tra là từ khóa
được chọn là theo “tên sách”, “tác giả” hay “nhà xuất bản”. Và hiện
thị kết quả tìm kiếm lên màn hình.
Exception 1a. Ô nhập từ khóa tìm kiếm còn trống
2a. Sách theo từ khóa đã nhập vào không tồn tại trong hệ thống
Scenarios Mô tả
U004#01 Trên màn hình là danh sách các sách cùng tên
U004#02 Trên màn hình là danh sách các sách của cùng 1 tác giả
U004#03 Trên màn hình là danh sách các sách của cùng một nàh xuất bản
U004#04 Hệ thống không tồn tại sách theo yêu cầu của người dùng
U004#05 Người dùng chưa nhập từ khóa tìm kiếm
• Check usage status
Usecase ID U005
Name Kiểm tra trạng thái sử dụng
Summary Hệ thống kiểm tra trạng thái sách của thư viện khi người dùng mượn
hoặc trả sách
Actor Quản lý thư viện, người dùng
Precondition Quản lý thư viện, khách hàng đã đăng nhập thành công vào hệ thống
15
Description N
o

Tác động
1 Người sử dụng hệ thống sử dụng chức năng “kiểm tra trạng thái
sử dụng” trên màn hình hiển thị sau khi đã đăng nhập thành
công vào hệ thống.
2 Hệ thống lấy thông tin ID, tên, thời điểm mượn của sách đang
mượn.
3 Hệ thống lấy thông tin ID, tên, thời điểm trả của sách.
4 Nếu thời điểm trả hoặc thời điểm kiểm tra hiện tại lớn hơn thời
điểm hạn trả sách thì hệ thống sẽ tăng mức cảnh báo.
5 Hệ thống hiển thị ra màn hình thông tin của người dùng về:
• ID, tên sách đang mượn, thời điểm thực hiện mượn, thời
điểm hạn phải trả sách.
• ID, tên sách đã trả, thời điểm thực hiện mượn, thời điểm
trả sách
• ID, tên sách quá hạn, thời điểm mượn, thời điểm phải trả,
thời gian quá hạn, mức cảnh báo và quy định
Exception 4a Hệ thống thông báo “Không có sách nào quá hạn” cho người sử
dụng khi không có sách nào quá hạn
3a Hệ thống thông báo ‘Không có sách mượn “ cho người dùng biết
khi chưa mượn hoặc trả quyển sách nào.
2a Hệ thống thông báo ‘Không có sách mượn “ cho người dùng biết
khi chưa mượn hoặc trả quyển sách nào.
Scenarios Mô tả
U005 - #01 Người dùng sử dụng thành công chức năng kiểm tra trạng thái sử
dụng và hệ thống hiển thị thông tin ra mà hình.
U005 - #02 Hiển thị thông tin tương ứng khi người dùng không vi phạm thời
điểm hạn trả sách.
U005 - #03 Hiển thị thông báo khi người dùng chưa mượn/ trả sách của thư
viện.
16

Logical Data Modeling
Screen/Slip Design
Object Analysis
Scenario Analysis
II. High Level Design.
High Level Design bao gồm các bước sau:
1.Scenario Analysis. (Phân tích kịch bản).
Ở bước phân tích kịch bản ta xác đinh các đối tượng mà ta sẽ sử dụng rồi
dùng chúng để vẽ biểu đồ tuần tự cho từng Use Case. Trong biểu đồ tuần tự thứ tự
từ trên xuống dưới là theo thứ tự thời gian. Chiều mũi tên từ A B tức là trong
một đoạn code nào đó của A phải gọi B, và phương thức trên mũi tên phải là một
phương thức có trong B.
17
1.1. Lending Book.
Object Boundary Entity Objects Control Object
• Lending Screen.
• Result lending
screen.
• Lending error
screen.
• User.
• Book.
• Librarian.
• Book Item.
• Reservation.
• Lending.
• Lending Controller.
• User Manager.
• Book Manager.
• Book Item

Manager.
• Book Item
Manager.
• Lending Manager.
• Reservation
Manager
Biểu đồ tuần tự :
User Lendin
g
screen
Result
Lending
Screen
Error
Screen
Lending
Controller
User
Manager
Book
Manager
Book
Item
Manager
Lending
Manager
Reservatio
n
Manager
User Book Librarian Book

Item
Lending
lending(UserID, BookID, BookItemID)
Search(UserID)
Search(BookItemID)
CheckAvailable(BookItemID)
Check overdue(UserID)
GetNewLendingNumber()
CheckNumberofBook(UserID)
Lending(LendingNumber, User, BookItem, LendingDate)
Register(lending)
SetState(lending)
18
Lend()
1.2. Log on.
a. Các đối tượng.
Boundary Entity Objects Control Object
• Logon Screen.
• Result Log on
Screen.
• Logon Error
Screen.
• User.
• Librarian.
• User Manager.
• Logon Controller.
b. Biểu đồ tuần tự.
User Logon Screen Result Logon Logon Logon User User Librarian
Screen Error Screen Controller Manager
LogOn()

LoggingOn(UserID, Password)
Search(UserID, password)
Compare(UserID, Password)
Compare(UserID, Password)
• Logon(): Hàm thực hiện chức năng Log on của hệ thống.
• LoggingOn(UserID, Password): Hàm nhận tham số vào là UserID và
Password mà hệ thống đọc được khi người dùng nhập vào.
• Search(UserID, Password): Hàm này thực hiện việc tìm kiếm UserID và
Password của UserID đó trong cơ sở dữ liệu và trả về giá trị TRUE nếu tìm
thấy và FALSE nếu không tìm thấy.
• Compare(UserID, Password): thực hiện so sánh UserID và Password với
UserID và Password của từng đối tượng User.
19
1.3. Reservation.
a. Các đối tượng.
Boundary Entity Objects Control Object
• Reservation Screen.
• Result Reservation
Screen.
• Reservation Error
Screen.
• User.
• Book.
• Reservation.
• User Manager.
• Reservation
Controller.
• Book Manager.
• Reservation
Manager.

b. Biểu đồ tuần tự.
User Reservatio
n
Screen
Result
Reservation
Error
Reservatio
n
Reservatio
n
Controller
Reservatio
n
Manager
Book
Manager
User
Manager
Use
r
Boo
k
Reservation

Reserve()
Reserving( UserID, BookID)
CheckNumberofReservedBook(UserID)
GetNumberofReservedBook()
CheckBookAvailable(BookID)

GetReservationNumber()
Reserving(reservationNumber, User, Book, ReservingDate)
ChangeNumberofBook()
SetNumberofBook()
ChangeNumberofReservedBook ()
SetNumberofReservedBook()
• Reserving (UserID, BookID): hàm thực hiện chức năng mượn sách, nhận
đầu vào là BookID người dùng nhập vào và UserID cập nhật từ hệ thống khi
người dùng đăng nhập.
20
• ChekNumberofBook(UserID): kiểm tra xem số sách người dùng mượn có
nhỏ hơn 10 không.
• GetNumberofReservedBook(): lấy thong tin về số lượng sách đã mượn của
người dùng.
• CheckBookAvailable(BookID): Kiểm tra xem sách có sẵn cho việc đặt
không.
• GetReservationNumber():tạo một số đặt sách mới.
• Reserving(reservationNumber, User, Book , ReservingDate): hoàn thành
một việc đặt sách mới.
• ChangeNumberofBook(): thay đổi số lượng sách của quyển đã mượn(giảm
đi 1).
• SetNumberofBook(): thiết lập số lượng sách mới .
• ChangeNumberofReservedBook(): thay đổi số lượng sách mà người dùng đã
mượn(tăng lên 1).
• SetNumberofReservedBook(): thiết lập số lượng sách đã đặt trong đối
tượng User.
1.4. Searching Book.
a. Các đối tượng.
Boundary Entity Objects Control Object
• Searching Screen.

• Result Searching
Screen.
• Error Searching
Screen.
• User.
• Book.
• Key.
• User Manager.
• Searching
Controller.
• Book Manager.
• Keyword Manager.
21
b. Biểu đồ tuần tự.
User Searching
Screen
Result
Searching
Screen
Error
Searching
Screen
Searching
Cotroller
User
Manager
Book
Manager
Keyword
Manager

User Book Key
Search()
Searching(Keyword, TypeofKey)
CheckTypeofKey(TypeofKey)
CaseSearchBook( CaseSearching)
Compare(Keyword)
• Searching(Keyword, TypeofKey): tìm kiếm sách với keyword người dùng
nhập vàovà loại keyword mà người dùng chọn(tên sách, nhà xuất bản hay
tên tác giả).
• CheckTypeofKey(TypeofKey): Kiểm tra xem người dùng chọn tìm theo tên
sách, tên tác giả hay nhà xuất bản. Hàm trả lại giá trị nguyên xác định trường
hợp tìm sách là theo tác giả, nhà xuất bản hay tên sách.
• CaseSearchBook(CaseSearching): Thiết lập tham số trường hợp tìm sách
trong đối tượng BookManager.
• Compare(Keyword): tùy vào giá trị của CaseSearching sẽ so sách keyword
với thuộc tính tên sách, tên tác giả hay nhà xuất bản trong Book.
1.5. Register. (Đăng kí người dùng).
a. Các đối tượng.
22
Boundary Entity Objects Control Object
• Register Screen.
• Result Register
Screen.
• Error Register
Screen.
• User.
• Account.
• User Manager.
• Register Controller.
• Account Manager.

Account: là một đối tượng có thuộc tính danh sách các UserID và password tương
ứng. Các phương thức của nó hỗ trợ việc quản lý account như: Thêm vào danh
sách, sửa password , xóa account, tìm kiếm một account.
b. Biểu đồ tuần tự.
User Register
Screen
Result Register
Screen
Register
Controller
Account
Manager
User
Manger
User Account
Register()
Register(UserID, Password, Class, Home, Tel)
CheckAvailable(UserID)
Search(UserID)
GetNewaccount(UserID, Password)
CreateNewAccount(UserID, Password)
GetNewUser(UserID, Password, Class, Home, Tel)
CreateNewUser(UserID, Password, Class, Home, Tel)
• Register(): Hàm này thực hiện khi người sử dụng chọn chức năng register
của hệ thống.
• Register(UserID, Password, Class, Home, Tel).
• CheckAvailble(UserID): Kiểm tra xem UserID này có khả dụng không.
• Search(UserID): Tìm kiểm xem trong đối tượng account có UserID không.
23
• GetNewAccount(UserID, Password): tạo một tài khoản mới.

• CreateNewAccount(UserID, Password): tạo một tài khoản mới, thêm vào
Account.
• GetNewUser(UserID, Password, Class, Home, Tel),
CreateNewUser(UserID, Password, Class, Home, Tel): tạo một đối tượng
người sử dụng mới với các thuộc tính UserID, Password, Class, Home, Tel.
1.6. Returning Book (Trả sách).
a. Các đối tượng.
Boundary Objects Entity Objects Control Object
• Returning Screen
• Returning Result
Screen.
• Error Screen
• User.
• Book Item
• Book
• Lending
• ReturningController.
• User Manager.
• BookItem Manager.
• Book Manager.
• Lending Manager.
b. Biểu đồ tuần tự.
Use
r
Returning
Screen
Returning
Result
Screen
Error

Screen
Returning
Controlle
r
User
Manager
BookItem
Manager
Book
Manager
Lendin
g
Manger
Use
r
Book
Item
Lendin
g
Book
returning()
returning(UserID, BookItemID, BookID)
Search(UserID)
ChangeNumberofLending(UserID)
SetNumberofLendngBook(UserID)
ChangeState(BookItemID)
SetState(BookID)
ChangeNumberofBook(BookID)

SetNumberofBook(BookID)

• Search(UserID): Tìm kiếm người trả sách ứng với UserID nhập vào.
• ChangeNumberofLendingBook(UserID): thay đổi số sách mà người dùng
mượn.
24
2. Object Analysis. (Phân tích đối tượng).
Trong bước phân tích đối tượng , trên cơ sở phân tích kịch bản, ta xác định
xem các đối tượng có các thuộc tính và phương thức gì. Từ đó ta vẽ biểu đồ
lớp.
3. Logical Data Modeling (Mô hình hóa dữ liệu lôgic).
BookItem:
Key Type
BookItemID primary varchar
BookID null varchar
State null Bool
25

×