Академический Документы
Профессиональный Документы
Культура Документы
Outline
Understanding Requirements
Manager Design Pattern
Advanced Features
Testing and Grading
Implementation Hints
Understanding Requirements
We provide several classes:
Book, User, Library, etc.
That provide the functionality of the library
system.
You can build library management system on your
own.
Or build library management system by using our
design.
But you must follow some rules.
Rules
If you try to build it on your own, please pay
attention to CLI Standard and how we test
your project.
Do not submit project with unfinished
methods.
Understanding Requirements
A Users perspective
As a reader
- Login & Logout
- Change Password
- Borrow, Return, Renew and Reserve Books
- List all borrowed/reserved books
- Inquiry my penalty
A reader use username to identify itself
A Users perspective
Whats the difference between teachers and
students.
- The reader Type(TEACHER and STUDENT)
- The number of books that can be borrowed
- The Borrowed-Expired-Days
- Only teachers can reserve books.
A Users perspective
As an admin
- Login & Logout
- Change Password
- Create a new User/Book/Kind
- Update an existing User/Book/Kind
- Remove an existing User/Book/Kind
- List all Users
An admin use username to identify itself as well
A Books Perspective
Difficulties in understanding
Book(something in the real world)
Kind(a class/type of Book)
- C++ Primer(a Kind)
- My C++ Primer ( a Book)
A Books Perspective
A Kind has the following attributes
- ISBN
- Book-name
- Authors(a series of authors)
No two Kinds share the same ISBN
A Books Perspective
A Book has the following attributes
- Kind
- Index
No two Books share the same Index
The process of reserving books
Priority for reserving books
A Books Perspective
Reserving priority
- Books have not been borrowed
- Books have been borrowed but have not
been reserved by another User
Architecture overview
Library
Reader
Manager
Student
Teacher
Admin
Manager
Kind
Manager
Book
Manager
Reader
Admin
Kind
Book
User
CLI
Object
ObjectManager
CLI
Data(external file)
Advanced Features
reorderResults
searchLikeName
searchByExpress
- Simple cases
- Powerful cases
A + B
A B
Command-line interface
Standard of CLI
Restart
Authentication
User-user
User-book
Time
Query
Authentication
User-user
User-book
Time
Query
Implementation Hints
Pointer
std::vector
Wide-character set
- wchar_t vs. char
- std::wstirng vs. std::string
- conversion
File Operations
- Check file existence
- Read from a file & Write to a file
Implementation Hints
Pointer vs. Reference
- How to create a new object
- How to remove an object
std::vector
- Vectors are a kind of sequence container. As such,
their elements are ordered following a strict linear
sequence.
- http://www.cplusplus.com/reference/stl/vector/
Implementation Hints
Vectors are good at:
- Accessing individual elements by their
position index (constant time).
- Iterating over the elements in any order
(linear time).
- Add and remove elements from its end
(constant amortized time).
Implementation Hints
Conversion between string and wstring
Find materials about character set and
encodings by yourself.
The following codes are supposed to be
compiled under Windows(Win32 Platform)
#include <windows.h>