How huynhducphu2502/hotel-management works
Project’s Main Components
• User Interface Layer: Represented by the FXML files (located in src/main/resources/iuh/fit/view and its subdirectories) which define the various UI panels for login, main dashboard, room booking, customer and employee management, invoicing, backup/restore, and statistics.
• Controllers Layer: All the classes in the src/main/java/iuh/fit/controller folder (including its features subfolders) form the presentation/business logic controllers that process user events from the UI and interact with other layers.
• Data Access Layer (DAO): The DAO classes in src/main/java/iuh/fit/dao and its subpackages abstract the interactions with the database, performing CRUD operations on entities such as Customer, Employee, Room, Invoice, etc.
• Domain/Model Layer: The classes in src/main/java/iuh/fit/models (as well as the enums and wrapper classes) represent the business entities and their attributes, which are passed across layers.
• Utility and Security Components: Additional utilities (src/main/java/iuh/fit/utils) provide supportive operations such as database connections, file handling, backup, and more. The security package (and related resource files) handles password hashing and configuration for application security.
• Database: While the physical database isn’t part of the codebase, the existence of SQL scripts (in the sql_script folder) for production and testing suggests integration with a relational database.
Relationships and Interactions
• Directional flow starting from the UI layer (JavaFX FXML views) that triggers user actions.
• That these actions are handled by the Controllers, which then invoke business logic.
• Controllers interact with the DAO layer to carry out persistence operations or retrieve data.
• The DAOs work with the underlying Database (possibly through helper utilities, e.g., DBHelper) and use SQL scripts for schema management.
• Utilities and security services support various layers by providing helper methods for tasks such as property management, backup/restore functions, and secure password handling.
Architectural Patterns and Design Principles
• Layered (n-tier) architecture: Distinct separation between UI, controller, data access, and business entities.
• MVC Pattern: The splitting of the visual elements (FXML/JavaFX UI views) from the Controllers that manage logic and DAOs/Models handling data.
• Modularity: The project is organized into different modules (or features) such as employee management, room booking, invoicing, statistics, and backup/restore.
• Use of dependency injection and configuration management (as indicated by property files and a Maven pom.xml) to handle build, settings, and environmental differences.
Technologies, Frameworks, and Other Elements
• Java with Maven (pom.xml) for project management.
• JavaFX for the User Interface (as seen through .fxml files and stylesheets in src/main/resources/iuh/fit/styles).
• JDBC or a similar library for database connectivity (implied by the database helper classes).
• SQL for database operations (along with dedicated SQL scripts).
• Security implementations (password hashing, property-based security configurations).