By Sota Ogo, Derek Willms
We used MVC + Router as our software architecture. We utilize singleton to keep the data consitancy (Singleton shouldn't be use in a real project for data storing; however, our assumption is that this library system won't be operated by multiple people at the same time.).
.
├
├── Collections // Collections
├── Controller // Controllers
├── lib // Utilities, Router, Request
│ └── Request // Request
├── Model // Models
│ └── Book // Books
├── tests // Test specs for Unit test
└── View // Views
make clean
make
./shhh data4books.txt data4patrons.txt < data4commands.txt
Please refer the following files:
- Diagram_class.pdf
- Diagram_sequence.pdf
We use Binary tree for book sorting, and Hash Table for searching. For history, we use linked list to keep track of user history.
- Everything starts from Router. View or main.cpp uses Router, in order to call controller.
- Controller updates the state of the software (Views and Models).
In controller, we implemented actions such as checkout, return, and display.
Models represents all kinds of data (User, Book, History)
Collection represents a set of models. There are "Indexed" and "UnIndexed" for collections. They have different data structures.
View represents the system states. Any kinds of output except errors are generated in View.
Router manages which controller to be called from user command.
Request is a data parser utility. It allows classes (Controller, View, Model) to have the same language (input structure).
Catch is a testing framework for c++. We used it for our unit testing. To enable the debug mode, please uncomment a line in lib/Config.h