# nguyen1976/java_oop_pka_nhom_10 architecture

> Architecture diagram of the GitHub repository nguyen1976/java_oop_pka_nhom_10, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nguyen1976/java_oop_pka_nhom_10
- Repository: https://github.com/nguyen1976/java_oop_pka_nhom_10

## Overview

##### Main Components

a) Presentation Layer (UI):
- JavaFX Views (LoginView, HospitalView, PatientView, TreatmentRoomView)

b) Controller Layer:
- Controllers (HospitalController, LoginViewController, etc.)
- Their relationships to both Views and Models

c) Model Layer:
- Core domain entities (Hospital, Patient, TreatmentRoom, Address)

d) Data Access Layer:
- PatientDAO and TreatmentRoomDAO
- DBConnection component

e) External Systems:
- MySQL Database (referenced in hospitalmanage.sql)
- File System Storage (for hospitalPatientInfo.txt)

##### Connection and Flow Representation

- User interaction flow from Views → Controllers
- Business logic flow from Controllers → Models
- Data persistence flow from DAOs → Database
- File operations flow to/from the file system

##### Specific Implementation Details

Specialized components:
- Utils package (BackToHome, LogOut)
- JDBC Connection management
- Authentication flow
- File I/O operations

**[UI Layer (JavaFX Views)]**
- ↓
**[Controller Layer]**
- ↓
**[Model Layer]**
- ↓
**[Data Access Layer]**
- ↓
**[External Systems]**

##### Additional Elements

- System boundaries
- External integration points

##### Key Relationships to Highlight

- Login flow: LoginView → LoginViewController → Database
- Patient management: PatientView → PatientViewController → PatientDAO → Database
- Treatment room management: TreatmentRoomView → TreatmentRoomViewController → TreatmentRoomDAO → Database
- File operations: Controllers → File System

##### Technical Details

- JavaFX FXML integration
- JDBC database connectivity
- File I/O mechanisms
- MVC pattern implementation

Remember to include:
- Clear component boundaries
- Data flow directions
- System integration points
- Technology stack indicators
- Security boundaries (especially around login)

This will provide a comprehensive view of the hospital management system's architecture while maintaining clarity and usefulness for development and maintenance purposes.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef ui fill:#e1f5fe,stroke:#01579b
    classDef controller fill:#ffe0b2,stroke:#e65100
    classDef model fill:#c8e6c9,stroke:#2e7d32
    classDef dao fill:#fff9c4,stroke:#f9a825
    classDef external fill:#f5f5f5,stroke:#616161
    classDef utils fill:#e1bee7,stroke:#6a1b9a

    %% UI Layer
    subgraph UI
        LV["Login View"]:::ui
        HV["Hospital View"]:::ui
        PV["Patient View"]:::ui
        TV["Treatment Room View"]:::ui
    end

    %% Controller Layer
    subgraph Controllers
        LC["Login Controller"]:::controller
        HC["Hospital Controller"]:::controller
        PC["Patient Controller"]:::controller
        TC["Treatment Room Controller"]:::controller
    end

    %% Model Layer
    subgraph Models
        H["Hospital"]:::model
        P["Patient"]:::model
        TR["Treatment Room"]:::model
        A["Address"]:::model
    end

    %% Data Access Layer
    subgraph DAL
        DBC["DB Connection"]:::dao
        PDAO["Patient DAO"]:::dao
        TDAO["Treatment Room DAO"]:::dao
    end

    %% External Systems
    subgraph External
        DB[(MySQL Database)]:::external
        FS[("File System<br/>hospitalPatientInfo.txt")]:::external
    end

    %% Utility Components
    subgraph Utils
        BTH["Back To Home"]:::utils
        LO["Logout"]:::utils
    end

    %% Relationships
    LV --> LC
    HV --> HC
    PV --> PC
    TV --> TC

    LC --> DBC
    HC --> H
    PC --> P
    TC --> TR

    P --> A
    TR --> H

    PC --> PDAO
    TC --> TDAO
    PDAO --> DBC
    TDAO --> DBC
    DBC --> DB

    PC --> FS
    HC --> BTH
    HC --> LO

    %% Click Events
    click LV "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/resources/com/finalproj/LoginView.fxml"
    click HV "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/resources/com/finalproj/HospitalView.fxml"
    click PV "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/resources/com/finalproj/PatientView.fxml"
    click TV "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/resources/com/finalproj/TreatmentRoomView.fxml"
    
    click LC "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/java/com/finalproj/Controller/LoginViewController.java"
    click HC "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/java/com/finalproj/Controller/HospitalController.java"
    click PC "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/java/com/finalproj/Controller/PatientViewController.java"
    click TC "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/java/com/finalproj/Controller/TreatmentRoomViewController.java"
    
    click H "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/java/com/finalproj/Modal/Hospital.java"
    click P "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/java/com/finalproj/Modal/Patient.java"
    click TR "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/java/com/finalproj/Modal/TreatmentRoom.java"
    click A "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/java/com/finalproj/Modal/Address.java"
    
    click DBC "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/java/com/finalproj/JDBCConnection/DBConnection.java"
    click PDAO "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/java/com/finalproj/JDBCConnection/PatientDAO.java"
    click TDAO "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/java/com/finalproj/JDBCConnection/TreatmentRoomDAO.java"
    
    click BTH "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/java/com/finalproj/Utils/BackToHome.java"
    click LO "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/deploy/src/main/java/com/finalproj/Utils/LogOut.java"
    
    click DB "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/SQL/hospitalmanage.sql"
    click FS "https://github.com/Nguyen1976/JAVA_OOP_PKA_Nhom_10/blob/main/src/main/java/com/finalproj/datafiles/hospitalPatientInfo.txt"
```
