How davichone/manager_hotel_ui_java_swing works
1. What this repo is
- A Java Maven desktop application with a strong Swing UI footprint.
- The naming strongly suggests a hotel / lodging management system: rooms, reservations, clients, employees, login, boletas/invoices, booking, solicitudes, and reporting.
2. Top-level architectural shape
- The code is organized in a classic layered style:
- vista = presentation layer
- modelo.logica / modelo.servicio = business/application logic
- modelo.dao = persistence access
- modelo.dto / modelo.entidades = data model
- This separation is important for diagramming because UI does not appear to talk directly to persistence; it likely goes through services/DAOs.
3. Presentation layer
- src/main/java/vista/forms contains multiple Swing forms such as:
- LoginForm, BookingForm, HabitacionesForm, RegistroClienteForm, RegistroEmpleados, ChartForm, ActivosForm, GoSolicitudForm, HistorialSolicitudForm.
- The paired .form files indicate these were built with a GUI designer rather than hand-coded layouts.
- These screens represent the main user entry points into the system.
4. Domain model
- modelo.entidades contains the core business entities:
- Persona, Empleado, Huesped, Usuario, Rol
- service-related entities like ServicioAdicional, ServicioAguaCaliente, ServicioEstacionamiento, ServicioSauna
- modelo.dto mirrors many of these concepts as transfer objects:
- ClienteDTO, EmpleadoDTO, HabitacionDTO, ReservaDTO, SolicitudDTO, BoletaDTO, UsuarioDTO, etc.
- This suggests the app separates persistent/business entities from transport/view-friendly DTOs.
5. Persistence boundary
- modelo.dao contains one DAO per main aggregate:
- ClienteDAO, EmpleadoDAO, HabitacionDAO, ReservaDAO, SolicitudDAO, UsuarioDAO, RolDAO, BoletaDAO, ItemDAO, PersonaDAO, DataGraficDAO
- This is the repository’s main persistence boundary; DAOs likely encapsulate JDBC queries and CRUD logic.
- There is no sign of JPA/Hibernate; the presence of ConexionBD and DAO classes suggests manual database access, likely via JDBC.
6. Business/application services
- modelo.servicio contains higher-level orchestration:
- BoletaService, ClienteService, EmpleadoService, ReservaService, ItemService, DataGraficService
- EcxelService for spreadsheet export
- GeneradorChartPDF for PDF reporting
- SolicitudDAOImpl appears here as an implementation-oriented class, which may bridge DAO/service responsibilities
- These services likely coordinate validation, persistence calls, and document/report generation.
7. Login and session-related flow
- modelo.logica.Login plus vista.forms.LoginForm indicate a dedicated authentication flow.
- Usuario, Rol, and Persona entities show the system likely supports role-based access or at least user identity management.
- For an architecture diagram, this is the main access-control boundary before users reach reservation/employee/room functions.
8. Document generation and templates
- modelo.logica contains generators:
- GenerarBoleta, GenerarBooking, GenerarSolicitud
- src/main/java/vista/templates contains HTML templates:
- Boleta.html, Booking.html, SolicitudActivos.html
- The generated HTML files in the repo root (boleta_*.html, factura_*.html, reporte_clientes.html, Solicitud_*.html) indicate the application produces exported documents/reports as artifacts, likely from those templates.
9. Reporting and analytics
- ChartForm, DataGraficDAO, DataGraficDTO, DataGraficService, and GeneradorChartPDF form a reporting subsystem.
- The presence of reporte_clientes.html suggests the app can generate customer reports, and probably chart-based summaries exported to PDF/HTML.
- EcxelService indicates another export path, likely for tabular reporting.
10. External dependencies and runtime
- pom.xml and the Maven wrapper (mvnw, .mvn/) show it is a Maven-managed Java project.
- lib/ includes:
- jcalendar for date picking in forms
- jgoodies-* for Swing UI/look-and-feel helpers
- junit-4.6 for tests
- These dependencies reinforce that this is a desktop UI application, not a web application.
11. Likely end-to-end data flow
- User interacts with a Swing form.
- Form calls a service or logic class.
- Service uses DAO(s) to read/write domain data through ConexionBD.
- For booking/boleta/solicitud/reporting, services/generators render HTML templates and produce output files.
- Reporting screens likely query aggregated data via DataGraficDAO/Service.
12. Important architectural boundaries to show
- UI boundary: Swing forms and HTML templates.
- Service boundary: business orchestration and document generation.
- Persistence boundary: DAOs plus database connection.
- Output boundary: generated HTML/PDF/Excel artifacts stored externally.
- These are the key boxes and arrows for an accurate diagram.
13. What stands out in the repo
- It is not a microservice or web stack; it is a client-side enterprise app.
- It mixes transactional CRUD with document/report generation.
- The repeated output files in the root imply the app is actively used to generate customer- and reservation-facing documents, not just internal data entry.
14. One caveat
- The repository tree alone does not show the database engine, schema, or exact UI event wiring.
- But the structure clearly points to a Swing + service + DAO + JDBC architecture with HTML-based document generation.
Main entry points: Login.java Login · GenerarBooking.java Booking Gen · GenerarSolicitud.java Solicitud Gen · ReservaService.java Reserva Service
Components 25
Presentation
Swing desktop screens and user entry points
- Main · Application entry point
src/main/java/main/Principal.java - Login · Authentication screen
src/main/java/vista/forms/LoginForm.java - Booking · Reservation workflow screen
src/main/java/vista/forms/BookingForm.java - Rooms · Room management screen
src/main/java/vista/forms/HabitacionesForm.java - Clients · Client registration screen
src/main/java/vista/forms/RegistroClienteForm.java - Employees · Employee registration screen
src/main/java/vista/forms/RegistroEmpleados.java - Charts · Reporting and chart screen
src/main/java/vista/forms/ChartForm.java - Requests · Request creation screen
src/main/java/vista/forms/GoSolicitudForm.java - History · Request history screen
src/main/java/vista/forms/HistorialSolicitudForm.java
Application
Authentication, orchestration, and document generation
- Login · Authentication and session checks
src/main/java/modelo/logica/Login.java - Booking Gen · Booking document generator
src/main/java/modelo/logica/GenerarBooking.java - Boleta Gen · Invoice/receipt generator
src/main/java/modelo/logica/GenerarBoleta.java - Solicitud Gen · Request document generator
src/main/java/modelo/logica/GenerarSolicitud.java - Reserva Service · Reservation orchestration
src/main/java/modelo/servicio/ReservaService.java - Cliente Service · Client orchestration
src/main/java/modelo/servicio/ClienteService.java - Empleado Service · Employee orchestration
src/main/java/modelo/servicio/EmpleadoService.java - Data Service · Aggregated reporting and analytics
src/main/java/modelo/servicio/DataGraficService.java - Chart PDF · Chart/report PDF generation
src/main/java/modelo/servicio/GeneradorChartPDF.java - Excel Export · Spreadsheet export
src/main/java/modelo/servicio/EcxelService.java
Persistence
DAOs and database connectivity
- DB Connection · Database connection helper
src/main/java/modelo/logica/ConexionBD.java - DAOs · CRUD and query boundary
Domain
Business entities and DTOs
- Entities · Core business entities
- DTOs · Data transfer objects
Connections 30
- Main → Login: launches · Starts the desktop application at the login screen
- Login → Login: authenticates · Routes credentials into the authentication logic
- Login → DAOs: checks user · Looks up users and roles through the persistence boundary
- Login → DB Connection: uses · Relies on the database connection helper
- Booking → Reserva Service: books · Submits reservation actions to the service layer
- Booking → Booking Gen: renders · Creates booking documents from the UI flow
- Rooms → DAOs: queries · Loads room state through DAOs
- Clients → Cliente Service: manages · Sends client registration and updates to the service layer
- Employees → Empleado Service: manages · Sends employee registration and updates to the service layer
- Requests → Solicitud Gen: creates · Generates request documents from the UI
- Requests → DAOs: persists · Stores request-related data through DAOs
- History → DAOs: reads · Displays historical request data from persistence
- Charts → Data Service: analyzes · Requests aggregated data for charts and reports
- Charts → Chart PDF: exports · Produces PDF chart/report output
- Data Service → DAOs: aggregates · Collects reporting data from DAOs
- Reserva Service → DAOs: stores · Coordinates reservation persistence
- Cliente Service → DAOs: stores · Coordinates client persistence
- Empleado Service → DAOs: stores · Coordinates employee persistence
- DAOs → DB Connection: executes · Runs JDBC operations through the connection helper
- Booking Gen → Templates: fills · Uses HTML template for booking documents
- Boleta Gen → Templates: fills · Uses HTML template for receipts and invoices
- Solicitud Gen → Templates: fills · Uses HTML template for requests
- Booking Gen → Artifacts: writes · Produces exported booking HTML files
- Boleta Gen → Artifacts: writes · Produces exported receipt and invoice HTML files
- Solicitud Gen → Artifacts: writes · Produces exported request HTML files
- Reserva Service → Entities: uses · Works with reservation and room domain objects
- Cliente Service → DTOs: maps · Moves client data through DTOs
- Data Service → DTOs: reads · Consumes reporting DTOs
- DAOs → Entities: persists · Reads and writes core entities
- DAOs → DTOs: projects · Shapes query results into DTOs