How loinguyenvan274/pbl_2 works
Project Type & Purpose
• This is a C++ application built for managing dormitory (ký túc xá) operations.
• It is a standalone desktop application that includes both core business logic (dormitory, room, student management) and a graphical user interface.
File Structure
• Top-Level Files:
– Files like .gitignore, Makefile, README.md indicate version control and a build process via Makefile.
– Executable files (e.g., index.exe) and assets demonstrate that the build output is a desktop application.
• Data Directory:
– Contains several CSV and text files (e.g., sinhVien.csv, phong.csv) alongside C++ source files in a subfolder (“data”). These likely serve as data stores for dormitory, room, and student records.
• & Lib Directories:
– "include" has headers like raylib.h, and "lib" contains raylib libraries, suggesting the usage of Raylib as a graphical library.
• src Directory:
– Divided into two major subdirectories:
• app – Contains core logic such as dormitory management (QuanLyKTX), room management (Phong), student management (sinhVien), file I/O (docGhiFile), and utility classes like Vector and BangBam.
• gui – Contains all UI aspects such as various windows (giaoDien, cuaSoCon), dialogs (hop, hopChu), and other GUI components that manage the display and interaction (e.g., giaoDienChinh, quanLyGiaoDien).
• Build & Doc Directories:
– The build directory holds generated executables, and the doc directory contains notes, which might include design documentation or reminders.
Key Architectural Components
a. Frontend / GUI Components:
• “src/gui” folder which includes the user interface modules, windows, and dialogs.
• That these modules are responsible for interacting with the user and rendering graphical elements using Raylib.
b. Business Logic / Application Layer:
• “src/app” folder which encapsulates business operations like dormitory management (QuanLyKTX), room (Phong) administration, student (sinhVien) processing, file operations (docGhiFile), and other utility classes.
c. Data Layer:
• Components for reading/writing files to persist application state.
d. External Libraries & Build Tools:
• Acknowledge the use of Raylib (include and lib folders) for the graphic interface.
• A note about the Makefile that manages the build process.
Relationships and Interactions
• Business Logic interacting with the Data Layer for reading from CSVs and writing changes.
• Build process (Makefile) as a separate element that feeds into the creation of the executable which bundles together these components.
Detailed Architectural Patterns and Design Principles
• Separation of concerns is fundamental: distinct layers for GUI and application logic.
• Modular design: Each source component (e.g., SinhVien handling, Phong management) is designed as an independent module.
• Data abstraction: Although data is stored in files (CSV and txt), encapsulated file I/O modules provide abstraction.
• Reusable external libraries: Raylib is isolated as the rendering layer, keeping UI code separate from business operations.