# fernandovcg33/programacion-2 architecture

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

- Interactive diagram: https://gitdiagram.com/fernandovcg33/programacion-2
- Repository: https://github.com/fernandovcg33/programacion-2

## Overview

##### Project type and purpose
- This is not a single product but a coursework repository for “Programación 2” (semester 1-2025).
- It contains multiple small Java applications (console and Swing GUI), each in its own top-level folder:
- Ajedrez (Chess CLI)
- Examenes/Segundo examen (Student records CLI)
- Futbol (Soccer CLI)
- Medallas (Medals CLI)
- interfaces_graficas/primera_interfaz (Simple GUI)
- interfaces_graficas/elecciones/Elecciones (Election management GUI)
- There is no central database or web server—each is a standalone Java module.

##### File structure
- Top-level directories represent independent sub-projects.
- Each sub-project follows the Java module layout:
- module-info.java at root of src
- src/<package> contains .java domain, UI, and Main classes
- Some GUI projects also include resource files (e.g., .txt data files).
- No build scripts (Maven/Gradle)—likely compiled/run via Eclipse or command line.

##### Examining the README
- Confirms this is an assignment-collection for a course.
- No further architectural guidance in the README.

##### Relationships and interactions
- Main → UI layer (invokes window creation or console prompts)
- UI layer → Domain layer (passes user input to model objects)
- Domain layer → Persistence layer (through Archivos utility)
- Persistence layer → Domain layer (on startup/load operations)

##### Architectural patterns and principles
- Each app is a simple layered monolith (Presentation → Domain → Persistence).
- No frameworks, just procedural/Swing code.
- Separation of concerns: keep UI code in window classes, domain logic in model classes, and file I/O in Archivos.

##### Technologies and libraries
- Java SE 9+ modules (module-info.java)
- Swing (interfaces_graficas projects)
- Plain files for data storage
- No external dependencies or databases

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Repository: programacion2_01_2025"
        direction TB
        Ajedrez["Ajedrez (Chess CLI)"]:::cliApp
        Examenes["Examenes/Segundo examen (Student Records CLI)"]:::cliApp
        Futbol["Futbol (Soccer CLI)"]:::cliApp
        Medallas["Medallas (Medals CLI)"]:::cliApp
        PrimeraInterfaz["interfaces_graficas/primera_interfaz (Simple GUI)"]:::guiApp
        EleccionesModule["interfaces_graficas/elecciones/Elecciones (Election GUI)"]:::guiApp
    end

    %% Elecciones detailed architecture
    subgraph "Elecciones Application Architecture"
        direction TB

        MainEl["Main"]:::presentation
        subgraph "Presentation Layer"
            direction TB
            VP["VentanaPrincipal"]:::presentation
            VRC["VentanaRegistroCandidato"]:::presentation
            VRP["VentanaRegistroPartido"]:::presentation
            VRRec["VentanaRegistroRecinto"]:::presentation
            VRV["VentanaRegVotante"]:::presentation
            VMC["VentanaModCandidato"]:::presentation
            VMP["VentanaModPartido"]:::presentation
            VMRec["VentanaModRecinto"]:::presentation
            VMV["VentanaModVotante"]:::presentation
            VRepC["VentanaRepCompleto"]:::presentation
            VRepRec["VentanaRepRecintos"]:::presentation
            VRepV["VentanaRepVotante"]:::presentation
        end

        subgraph "Domain Layer"
            direction TB
            CAND["Candidato"]:::domain
            PART["PartidoPolitico"]:::domain
            REC["Recinto"]:::domain
            VOT["Votante"]:::domain
            PERS["Persona"]:::domain
        end

        subgraph "Persistence Layer"
            direction TB
            TXTpart["partidos.txt"]:::persistence
            TXTrec["recintos.txt"]:::persistence
            TXTvot["votantes.txt"]:::persistence
        end

        IOUtil["Archivos"]:::utility

        %% Relationships
        MainEl -->|launches| VP
        MainEl -->|launches| VRC
        MainEl -->|launches| VRP
        MainEl -->|launches| VRRec
        MainEl -->|launches| VRV

        VP -->|calls| CAND
        VRC -->|writes| CAND
        VRP -->|writes| PART
        VRRec -->|writes| REC
        VRV -->|writes| VOT

        CAND -->|serialize via| IOUtil
        PART -->|serialize via| IOUtil
        REC -->|serialize via| IOUtil
        VOT -->|serialize via| IOUtil

        IOUtil -->|reads| TXTpart
        IOUtil -->|reads| TXTrec
        IOUtil -->|reads| TXTvot

        TXTpart -->|loaded into| PART
        TXTrec -->|loaded into| REC
        TXTvot -->|loaded into| VOT
    end

    %% Click Events for Elecciones module
    click MainEl "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/Main.java"
    click VP "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/VentanaPrincipal.java"
    click VRC "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/VentanaRegistroCandidato.java"
    click VRP "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/VentanaRegistroPartido.java"
    click VRRec "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/VentanaRegistroRecinto.java"
    click VRV "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/VentanaRegVotante.java"
    click VMC "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/VentanaModCandidato.java"
    click VMP "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/VentanaModPartido.java"
    click VMRec "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/VentanaModRecinto.java"
    click VMV "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/VentanaModVotante.java"
    click VRepC "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/VentanaRepCompleto.java"
    click VRepRec "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/VentanaRepRecintos.java"
    click VRepV "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/VentanaRepVotante.java"
    click CAND "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/Candidato.java"
    click PART "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/PartidoPolitico.java"
    click REC "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/Recinto.java"
    click VOT "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/Votante.java"
    click PERS "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/Persona.java"
    click IOUtil "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/src/y/Archivos.java"
    click TXTpart "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/partidos.txt"
    click TXTrec "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/recintos.txt"
    click TXTvot "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/elecciones/Elecciones/votantes.txt"
    click EleccionesModule "https://github.com/fernandovcg33/programacion-2/tree/main/interfaces_graficas/elecciones/Elecciones/"

    %% Click Events for top-level modules
    click Ajedrez "https://github.com/fernandovcg33/programacion-2/blob/main/Ajedrez/src/module-info.java"
    click Examenes "https://github.com/fernandovcg33/programacion-2/blob/main/Examenes/Segundo examen/src/module-info.java"
    click Futbol "https://github.com/fernandovcg33/programacion-2/blob/main/Futbol/src/module-info.java"
    click Medallas "https://github.com/fernandovcg33/programacion-2/blob/main/Medallas/src/module-info.java"
    click PrimeraInterfaz "https://github.com/fernandovcg33/programacion-2/blob/main/interfaces_graficas/primera_interfaz/interfaz1/src/Main.java"

    classDef cliApp fill:#bbdefb,stroke:#2196f3,color:#0d47a1;
    classDef guiApp fill:#c8e6c9,stroke:#2e7d32,color:#1b5e20;
    classDef presentation fill:#bbdefb,stroke:#1565c0;
    classDef domain fill:#c8e6c9,stroke:#2e7d32;
    classDef persistence fill:#fff9c4,stroke:#f9a825;
    classDef utility fill:#ffe0b2,stroke:#e65100;
```
