How nnminh-sam/library-management-app works
Main Components
• Domain Model / Business Logic:
• Title, Book, Reader, and BorrowedBook classes.
• Their relationships: a Title contains a linked list (catalogue) of Book objects; a Reader is stored in an AVL tree and has a BorrowedBookList (double linked list) of borrowing records.
• Data Structures Library:
• Custom implementations under the DataStructures directory (AVL Tree, DoubleLinkedList, LinkedList, DynamicArray, HashMap, etc.).
• Persistent Storage:
• "Databases" directory with text files and binary files to simulate persistent storage (e.g., DAU_SACH_DB.txt, DOC_GIA_DB.txt, indexes).
• UI/Presentation Layer:
• The Tabs folder contains various UI components (views for “DanhSachDauSach”, “DanhSachTheDocGia”, “LandingView”, “ThongKeTab”, UI elements such as Button, Component, Table, etc.).
• Helper & Utility Modules:
• Helper directory for constants, global variables, index generation, and packaging logic.
• Graphics / External Libraries:
• The Graphics directory shows usage of the BGI graphics libraries and related support files to render the UI.
Understand Relationships and Interactions
• User actions (via the UI components in the Tabs module) trigger operations in the business logic layer.
• The business logic uses the custom data structures to manage core entities efficiently.
• When changes occur (e.g., creation, update, deletion of data), the updates are reflected in the persistent text-based databases.
• The UI layer uses the Graphics module to display information, while Helper functions provide additional support (like generating indexes or managing configuration constants).
Architectural Patterns / Design Principles
• Although it’s all in one codebase, notice a separation of concerns: data management is achieved through encapsulated data structures; UI is managed in segregated “Tab” components; business rules are embedded in the Domain Model.
• The use of C++ Object-Oriented Programming and custom data-structures indicates a focus on performance and direct control over memory, albeit with some challenges (e.g., a noted memory leak).
Relevant Technologies and Frameworks
• Programming Language: C++20.
• UI/Graphics: BGI (graphics.h and its associated libraries).
• Build/Project Management: Visual Studio 2022 project (.sln file) with CMake support.
• Data Structures: Custom implementations for linked lists, AVL trees, etc.
What
• Clearly label major components: "Domain Model", "Data Structures", "UI Module", "Helper Utilities", "Persistent Database", and "Graphics Engine".
• From UI components to Domain Methods (e.g., when a user inputs a new "Title" or "Reader").
• From Domain/Business Logic to Data Structures (for storing and querying operations).
• From Domain to Database (for read/write of persistent storage).
• Incorporate annotations or notes regarding design decisions (e.g., “Uses AVL Tree for Reader list to ensure efficient searches/sorts”).
• Optionally, highlight how operations are affected by rules (e.g., borrowing restrictions and overdue check logic).
• Domain layer to the Database layer (text file representation) to illustrate persistence.