# davichone/manager_hotel_ui_java_swing architecture

> Architecture diagram of the GitHub repository davichone/manager_hotel_ui_java_swing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/davichone/manager_hotel_ui_java_swing
- Repository: https://github.com/davichone/manager_hotel_ui_java_swing

## Overview

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: [`src/main/java/modelo/logica/Login.java`](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/logica/Login.java) (Login), [`src/main/java/modelo/logica/GenerarBooking.java`](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/logica/GenerarBooking.java) (Booking Gen), [`src/main/java/modelo/logica/GenerarSolicitud.java`](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/logica/GenerarSolicitud.java) (Solicitud Gen), [`src/main/java/modelo/servicio/ReservaService.java`](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/servicio/ReservaService.java) (Reserva Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_main_principal(("Main<br/>launcher<br/>[Principal.java]"))
  node_login_form["Login<br/>swing form<br/>[LoginForm.java]"]
  node_booking_form["Booking<br/>swing form<br/>[BookingForm.java]"]
  node_rooms_form["Rooms<br/>swing form"]
  node_client_form["Clients<br/>swing form"]
  node_employee_form["Employees<br/>swing form"]
  node_chart_form["Charts<br/>swing form<br/>[ChartForm.java]"]
  node_solicitud_form["Requests<br/>swing form"]
  node_solicitud_history_form["History<br/>swing form"]
end

subgraph group_application["Application"]
  node_login_logic(("Login<br/>auth logic<br/>[Login.java]"))
  node_booking_gen["Booking Gen<br/>document gen"]
  node_boleta_gen["Boleta Gen<br/>document gen<br/>[GenerarBoleta.java]"]
  node_solicitud_gen["Solicitud Gen<br/>document gen"]
  node_reserva_service["Reserva Service"]
  node_cliente_service["Cliente Service"]
  node_empleado_service["Empleado Service"]
  node_data_service["Data Service<br/>report service"]
  node_chart_pdf["Chart PDF<br/>export service"]
  node_excel_service["Excel Export<br/>export service<br/>[EcxelService.java]"]
end

subgraph group_persistence["Persistence"]
  node_conexion_bd[("DB Connection<br/>jdbc<br/>[ConexionBD.java]")]
  node_dao_suite["DAOs<br/>dao layer"]
end

subgraph group_domain["Domain"]
  node_entities{{"Entities<br/>domain model"}}
  node_dtos{{"DTOs<br/>transfer model"}}
end

subgraph group_output["Output"]
  node_templates["Templates<br/>[Booking.html]"]
  node_artifacts["Artifacts<br/>generated html"]
end

node_main_principal -->|"launches"| node_login_form
node_login_form -->|"authenticates"| node_login_logic
node_login_logic -->|"checks user"| node_dao_suite
node_login_logic -->|"uses"| node_conexion_bd
node_booking_form -->|"books"| node_reserva_service
node_booking_form -->|"renders"| node_booking_gen
node_rooms_form -->|"queries"| node_dao_suite
node_client_form -->|"manages"| node_cliente_service
node_employee_form -->|"manages"| node_empleado_service
node_solicitud_form -->|"creates"| node_solicitud_gen
node_solicitud_form -->|"persists"| node_dao_suite
node_solicitud_history_form -->|"reads"| node_dao_suite
node_chart_form -->|"analyzes"| node_data_service
node_chart_form -->|"exports"| node_chart_pdf
node_data_service -->|"aggregates"| node_dao_suite
node_reserva_service -->|"stores"| node_dao_suite
node_cliente_service -->|"stores"| node_dao_suite
node_empleado_service -->|"stores"| node_dao_suite
node_dao_suite -->|"executes"| node_conexion_bd
node_booking_gen -->|"fills"| node_templates
node_boleta_gen -->|"fills"| node_templates
node_solicitud_gen -->|"fills"| node_templates
node_booking_gen -->|"writes"| node_artifacts
node_boleta_gen -->|"writes"| node_artifacts
node_solicitud_gen -->|"writes"| node_artifacts
node_reserva_service -->|"uses"| node_entities
node_cliente_service -->|"maps"| node_dtos
node_data_service -->|"reads"| node_dtos
node_dao_suite -->|"persists"| node_entities
node_dao_suite -->|"projects"| node_dtos

click node_main_principal "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/main/Principal.java"
click node_login_form "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/LoginForm.java"
click node_booking_form "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/BookingForm.java"
click node_rooms_form "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/HabitacionesForm.java"
click node_client_form "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/RegistroClienteForm.java"
click node_employee_form "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/RegistroEmpleados.java"
click node_chart_form "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/ChartForm.java"
click node_solicitud_form "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/GoSolicitudForm.java"
click node_solicitud_history_form "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/HistorialSolicitudForm.java"
click node_login_logic "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/logica/Login.java"
click node_booking_gen "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/logica/GenerarBooking.java"
click node_boleta_gen "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/logica/GenerarBoleta.java"
click node_solicitud_gen "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/logica/GenerarSolicitud.java"
click node_reserva_service "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/servicio/ReservaService.java"
click node_cliente_service "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/servicio/ClienteService.java"
click node_empleado_service "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/servicio/EmpleadoService.java"
click node_data_service "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/servicio/DataGraficService.java"
click node_chart_pdf "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/servicio/GeneradorChartPDF.java"
click node_excel_service "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/servicio/EcxelService.java"
click node_conexion_bd "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/logica/ConexionBD.java"
click node_templates "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/templates/Booking.html"
click node_artifacts "https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/reporte_clientes.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main_principal,node_login_form,node_booking_form,node_rooms_form,node_client_form,node_employee_form,node_chart_form,node_solicitud_form,node_solicitud_history_form toneBlue
class node_login_logic,node_booking_gen,node_boleta_gen,node_solicitud_gen,node_reserva_service,node_cliente_service,node_empleado_service,node_data_service,node_chart_pdf,node_excel_service toneAmber
class node_conexion_bd,node_dao_suite toneMint
class node_entities,node_dtos toneRose
class node_templates,node_artifacts toneIndigo
```

## Components

### Presentation

Swing desktop screens and user entry points

- [Main](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/main/Principal.java): launcher · Application entry point · `src/main/java/main/Principal.java`
- [Login](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/LoginForm.java): swing form · Authentication screen · `src/main/java/vista/forms/LoginForm.java`
- [Booking](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/BookingForm.java): swing form · Reservation workflow screen · `src/main/java/vista/forms/BookingForm.java`
- [Rooms](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/HabitacionesForm.java): swing form · Room management screen · `src/main/java/vista/forms/HabitacionesForm.java`
- [Clients](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/RegistroClienteForm.java): swing form · Client registration screen · `src/main/java/vista/forms/RegistroClienteForm.java`
- [Employees](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/RegistroEmpleados.java): swing form · Employee registration screen · `src/main/java/vista/forms/RegistroEmpleados.java`
- [Charts](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/ChartForm.java): swing form · Reporting and chart screen · `src/main/java/vista/forms/ChartForm.java`
- [Requests](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/GoSolicitudForm.java): swing form · Request creation screen · `src/main/java/vista/forms/GoSolicitudForm.java`
- [History](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/forms/HistorialSolicitudForm.java): swing form · Request history screen · `src/main/java/vista/forms/HistorialSolicitudForm.java`

### Application

Authentication, orchestration, and document generation

- [Login](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/logica/Login.java): auth logic · Authentication and session checks · `src/main/java/modelo/logica/Login.java`
- [Booking Gen](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/logica/GenerarBooking.java): document gen · Booking document generator · `src/main/java/modelo/logica/GenerarBooking.java`
- [Boleta Gen](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/logica/GenerarBoleta.java): document gen · Invoice/receipt generator · `src/main/java/modelo/logica/GenerarBoleta.java`
- [Solicitud Gen](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/logica/GenerarSolicitud.java): document gen · Request document generator · `src/main/java/modelo/logica/GenerarSolicitud.java`
- [Reserva Service](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/servicio/ReservaService.java): service · Reservation orchestration · `src/main/java/modelo/servicio/ReservaService.java`
- [Cliente Service](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/servicio/ClienteService.java): service · Client orchestration · `src/main/java/modelo/servicio/ClienteService.java`
- [Empleado Service](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/servicio/EmpleadoService.java): service · Employee orchestration · `src/main/java/modelo/servicio/EmpleadoService.java`
- [Data Service](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/servicio/DataGraficService.java): report service · Aggregated reporting and analytics · `src/main/java/modelo/servicio/DataGraficService.java`
- [Chart PDF](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/servicio/GeneradorChartPDF.java): export service · Chart/report PDF generation · `src/main/java/modelo/servicio/GeneradorChartPDF.java`
- [Excel Export](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/servicio/EcxelService.java): export service · Spreadsheet export · `src/main/java/modelo/servicio/EcxelService.java`

### Persistence

DAOs and database connectivity

- [DB Connection](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/modelo/logica/ConexionBD.java): jdbc · Database connection helper · `src/main/java/modelo/logica/ConexionBD.java`
- **DAOs**: dao layer · CRUD and query boundary

### Domain

Business entities and DTOs

- **Entities**: domain model · Core business entities
- **DTOs**: transfer model · Data transfer objects

### Output

Generated HTML artifacts and templates

- [Templates](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/src/main/java/vista/templates/Booking.html): html templates · HTML report and document templates · `src/main/java/vista/templates/Booking.html`
- [Artifacts](https://github.com/davichone/manager_hotel_ui_java_swing/blob/main/reporte_clientes.html): generated html · Exported HTML reports and receipts · `reporte_clientes.html`

## Connections

- 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
