How sudhirkumar85/hotel-management-system works
Project type and purpose
• This is a desktop-based hotel management system built in Java using the AWT/Swing GUI toolkit with JDBC connectivity to a MySQL database.
• It supports room management (add, update, delete, view), customer check-in/out, bill generation, bill storage, and user authentication (sign-in/up, password recovery).
File structure
• Top-level build files: build.xml, manifest.mf, NetBeans project files (nbproject/…).
• src/ directory:
• Form classes (*.form + corresponding .java) under src/, each representing one Swing GUI screen.
• Business logic class: src/hotel/management/system/HotelManagementSystem.java (likely application entry point).
• Database access helper: src/project/ConnectionProvider.java.
• src/image/: holds application images/screenshots (used in UI).
Additional architecture insights from README
• Layers implicitly follow a simple MVC-like separation:
• View: Swing forms (UI screens).
• Controller/Service: event handlers inside each form’s .java which communicate with business logic and DAOs.
• Data Access: ConnectionProvider + JDBC calls to MySQL.
• Packaged as an executable (.exe) for end-user deployment.
Main components
a. Presentation Layer (Swing UI)
• Each form class: Start, SignIn, Signup, PassWord, Home, Admin, ManageRoom, CustomerCheckIn, CustomerCheckOut, GenerateBill, CustomerDetailsBill.
b. Business Logic Layer
• HotelManagementSystem.java: orchestrates flow between UI events and database actions.
• Methods invoked by UI event listeners for room operations, customer operations, billing.
c. Data Access Layer
• ConnectionProvider.java: establishes JDBC connection to MySQL.
• SQL statements executed here or from service methods.
d. Database
• MySQL server storing tables for rooms, customers, bills, users.
e. Packaging/Deployment
• build.xml and NetBeans project files for building .jar/.exe.
Relationships and interactions
• UI screens send user actions (e.g., “Add Room”, “Check In”) to controller logic in each form.
• Controllers call helper/business classes in hotel.management.system or directly use ConnectionProvider.
• ConnectionProvider opens JDBC connections, executes CRUD operations on MySQL.
• Responses (success/failure, data sets) propagate back to UI for display.
• The application entry point initializes the loading screen (Start → Start1) then SignIn.
Architectural patterns and design principles
• Layered architecture: clear separation of Presentation, Business Logic, Data Access.
• Event-driven UI: Swing action listeners in each Form.
• Single Responsibility: each form handles one user workflow.
• Reusable DB connectivity: ConnectionProvider centralizes JDBC setup.
Detail without overthinking
• CRUD operations: room management, customer check-in/out, billing generation.
• How the ConnectionProvider is reused across forms.
• Transition from loading screen to login to main application.