How aricchong12/oop-project works
Project type & purpose (what you’re diagramming)
This is a Java desktop Hotel Management System (HMS) built with MVC:
• View: Java Swing UI screens (View/*)
• Controller: user-action handlers + orchestration (Controller/*)
• Model: domain entities (Model/*)
• Database: DB access layer (Database/Database.java) against a relational schema (hotel_management_system.sql)
Primary use cases implied by file names: login/register, room status, check-in/check-out, booking, payment.
What the file tree tells you (architectural boundaries)
Top-level modules are already cleanly separated:
View (Swing UI)
• Welcome, Login, Register
• MainFrame (likely main window / navigation shell)
• RoomStatus
• CheckIn, CheckOut
• Success (confirmation screen)
These are UI “components” that produce events (button clicks, form submits) and display results.
Controller (application orchestration)
• CustomerController (auth/registration/customer profile)
• RoomController (availability/status updates)
• BookingController (check-in/check-out logic likely maps here)
• PaymentController (billing/payment operations)
Controllers should be drawn as the application/service layer that sits between UI and DB.
Model (domain/entities)
• Customer, Room, Booking, Payment
These represent records/tables and in-memory objects.
Database (data access)
• Database/Database.java is the single visible DB boundary. It probably provides:
• connection management (JDBC)
• query/execute helpers
• transaction boundaries (if implemented)
This is your persistence layer.
SQL schema
The README explicitly states:
• MVC separation
• Controllers “manage transactions, update models, and coordinate database operations”
So emphasize:
• unidirectional dependency: View → Controller → Database
• Models are shared types across layers (Views may hold/consume them, Controllers definitely construct/update them, Database maps rows ↔ models)
Relational Database
• Desktop Client (JVM): contains View + Controller + Model + Database.java
• DB Server: contains the relational database engine + schema
Important architectural patterns to highlight
• MVC as the primary pattern.
• Layered architecture inside the desktop app:
• Presentation (Swing Views)
• Application/Control (Controllers)
• Domain (Models)
• Persistence (Database.java + SQL DB)
• If Database.java is a single gateway, call it out as a “Database Gateway / Repository-like helper” (even if it’s not a strict repository pattern).
• Java Swing on the View boundary
• Java (JVM) on the client boundary
• JDBC (likely) between Database.java and the RDBMS
Clear labels for each component
• Desktop App (contains View/Controller/Model/Database helper)
• SQL Database (external)
• Which Views talk to which Controllers
• Controllers using Database.java
• Database.java mapping to Models and persisting to DB tables
This satisfies “don’t overthink it” while still maximizing component separation and traceability to the actual repo.
Views → Controllers
• Welcome → (navigation to) Login / Register
• Login → CustomerController
• Register → CustomerController
• MainFrame → (hosts) RoomStatus, CheckIn, CheckOut
• RoomStatus → RoomController
• CheckIn → BookingController (and RoomController if room assignment is separate)
• CheckOut → BookingController + PaymentController
• Success ← result/confirmation from Controllers
Controllers → Models
• CustomerController ↔ Customer
• RoomController ↔ Room
• BookingController ↔ Booking, Room, Customer
• PaymentController ↔ Payment, Booking, Customer
Controllers → Database
• All Controllers → Database.java → SQL Database