# olarte91/reto-2_sistema_de_gestion_de_emergencias_urbanas architecture

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

- Interactive diagram: https://gitdiagram.com/olarte91/reto-2_sistema_de_gestion_de_emergencias_urbanas
- Repository: https://github.com/olarte91/reto-2_sistema_de_gestion_de_emergencias_urbanas

## Overview

##### Project Type and Purpose
- This is a Java application developed using Visual Studio Code. Although the README focuses on getting started with Java coding and folder organization, the file tree reveals an emergency response simulation or management system.
- The model classes (e.g., AccidenteVehicular, Ambulancia, Bomberos, Incendio, Policia, Robo) represent various emergencies and responders, while the service package (e.g., Emergencia, Responder) likely encapsulates business logic to process or simulate emergency events.

##### File Structure
- Top-level directories:
- .vscode: holds IDE configuration files.
- src: contains the source code, including App.java (the main entry point).
- bin: contains the compiled outputs laid out in a structure similar to the source (with separate directories for model, service, and utils).
- Subdirectories:
- src/model: contains domain classes that represent emergency events and responder entities.
- src/service: contains the main business logic classes that likely manage emergencies and coordinate the response.
- src/utils: contains auxiliary classes such as NivelGravedad for handling utility functions like determining severity.
- This structure generally reflects a separation of concerns (Application, Domain/Model, Service, and Utility), which is a common organized approach in Java applications.

##### README Insights
- The README describes the folder structure (src, lib, bin) and provides instructions for dependency management and customization via Visual Studio Code settings. While it is mostly boilerplate, it confirms that source files are in src and dependencies (if any) would reside in lib.

a. Main components:
- User Interface/Entry Point: Represented by App.java in the src directory.
- Service Layer: Contains classes like Emergencia and Responder. This layer is responsible for orchestrating emergency responses and applying business logic.
- Domain/Model Layer: Contains classes representing various emergency scenarios and responder entities (AccidenteVehicular, Ambulancia, Bomberos, Incendio, Policia, Robo).
- Utility Layer: Contains helper classes such as NivelGravedad, which provides supporting functionality (like assessing the severity of an incident).

b. Relationships and Interactions:
- The main application (App.java) initiates the process, likely creating instances of service classes to handle incoming emergency events.
- The service layer manages business rules, triggering operations on the domain models, and consulting utilities (e.g., NivelGravedad) as needed.

c. Architectural Patterns and Design Principles:
- Separation of Concerns: Splitting functionalities across multiple packages (src/model, src/service, src/utils) ensures that each layer has a distinct responsibility.
- Layered Architecture: The system is organized into separate layers (application, service, domain, and utilities), making it easier to manage, test, and maintain.
- Modularity and Encapsulation: Each package encapsulates a different facet of the system’s functionality, which can aid in future extensions (for example, adding new emergency types or response strategies).

d. Relevant Technologies and Frameworks:
- This project is a standard Java application without any explicit external frameworks mentioned, but Visual Studio Code integration and standard Java dependency management are in use.

##### Instructing the Principal Software Engineer to Include the Following Elements
- Application Layer (App.java)
- Service Layer (Emergencia, Responder)
- Domain/Model Layer (AccidenteVehicular, Ambulancia, Bomberos, Incendio, Policia, Robo)
- Utility Layer (NivelGravedad)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Application Layer"
        APP["App.java"]:::app
    end

    subgraph "Service Layer"
        EM["Emergencia"]:::service
        RE["Responder"]:::service
    end

    subgraph "Domain/Model Layer"
        AV["AccidenteVehicular"]:::model
        AM["Ambulancia"]:::model
        BM["Bomberos"]:::model
        IN["Incendio"]:::model
        PO["Policia"]:::model
        RO["Robo"]:::model
    end

    subgraph "Utility Layer"
        NG["NivelGravedad"]:::util
    end

    %% Application Layer calls Service Layer
    APP -->|"calls"| EM
    APP -->|"calls"| RE

    %% Service Layer interacts with Domain/Model Layer
    EM -->|"processes"| AV
    EM -->|"processes"| AM
    EM -->|"processes"| BM
    EM -->|"processes"| IN
    EM -->|"processes"| PO
    EM -->|"processes"| RO

    RE -->|"coordinates"| AV
    RE -->|"coordinates"| AM
    RE -->|"coordinates"| BM
    RE -->|"coordinates"| IN
    RE -->|"coordinates"| PO
    RE -->|"coordinates"| RO

    %% Service Layer uses Utility Layer
    EM -->|"evaluates"| NG
    RE -->|"evaluates"| NG

    classDef app fill:#add8e6,stroke:#333,stroke-width:2px;
    classDef service fill:#90ee90,stroke:#333,stroke-width:2px;
    classDef model fill:#ffffcc,stroke:#333,stroke-width:2px;
    classDef util fill:#ffcccb,stroke:#333,stroke-width:2px;

    %% Click Events
    click APP "https://github.com/olarte91/reto-2_sistema_de_gestion_de_emergencias_urbanas/blob/main/src/App.java"
    click EM "https://github.com/olarte91/reto-2_sistema_de_gestion_de_emergencias_urbanas/blob/main/src/service/Emergencia.java"
    click RE "https://github.com/olarte91/reto-2_sistema_de_gestion_de_emergencias_urbanas/blob/main/src/service/Responder.java"
    click AV "https://github.com/olarte91/reto-2_sistema_de_gestion_de_emergencias_urbanas/blob/main/src/model/AccidenteVehicular.java"
    click AM "https://github.com/olarte91/reto-2_sistema_de_gestion_de_emergencias_urbanas/blob/main/src/model/Ambulancia.java"
    click BM "https://github.com/olarte91/reto-2_sistema_de_gestion_de_emergencias_urbanas/blob/main/src/model/Bomberos.java"
    click IN "https://github.com/olarte91/reto-2_sistema_de_gestion_de_emergencias_urbanas/blob/main/src/model/Incendio.java"
    click PO "https://github.com/olarte91/reto-2_sistema_de_gestion_de_emergencias_urbanas/blob/main/src/model/Policia.java"
    click RO "https://github.com/olarte91/reto-2_sistema_de_gestion_de_emergencias_urbanas/blob/main/src/model/Robo.java"
    click NG "https://github.com/olarte91/reto-2_sistema_de_gestion_de_emergencias_urbanas/blob/main/src/utils/NivelGravedad.java"
```
