# ruthv46/itm_ds_patron_cr architecture

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

- Interactive diagram: https://gitdiagram.com/ruthv46/itm_ds_patron_cr
- Repository: https://github.com/ruthv46/itm_ds_patron_cr

## Overview

##### Main Components
- App Entry Point: The file "src/AppSolicitud.java" serves as the client or entry point for initiating operations.
- ATM Controller: The "src/dispensador/CajeroAutomatico.java" likely coordinates the ATM’s operations, processing requests and delegating the dispensing actions.
- Currency/Bill Handlers: Files named "Billete5000.java", "Billete10000.java", "Billete20000.java", "Billete50000.java", and "Billete100000.java" represent different bill denominations. They are possibly part of a chain-of-responsibility pattern, each handling a specific range or type of currency denomination.
- Interface Definition: "src/dispensador/IManejador.java" defines the handler contract, likely used to standardize how each bill handler processes dispensing requests.

##### File Structure
- The Client Layer includes the main application (AppSolicitud) that receives input/requests.
- The Business Logic Layer includes:
– CajeroAutomatico (the main controller)
– A series of bill handler components (Billete classes) that follow the IManejador interface contract.
- You could also illustrate the chain-of-responsibility pattern if that is indeed how the bill handlers are organized (i.e., each handler passes the request to the next if it cannot fully process the dispensing request).

##### Relationships and Interactions
- AppSolicitud:
- Acts as the user entry point, instantiating the CajeroAutomatico and initiating withdrawal or deposit requests.
- CajeroAutomatico:
- Receives the withdrawal (or operation) request from AppSolicitud.
- Delegates the request to the appropriate chain of bill handlers based on requested amount.
- Bill Handler Classes (Billete*):
- Each class implements IManejador.
- They are likely organized in a chain where each handler attempts to dispense as many bills of its denomination as possible before passing the remaining request to the next handler.

##### Architectural Patterns & Design Principles
- The Chain-of-Responsibility Pattern: Indicated by the presence of different bill classes and the IManejador interface, showing a clear intent to process a request through multiple handlers.
- Modularity & Extensibility: Each bill denomination is isolated in its own class, making it easier to adjust or extend behavior for specific denominations.

##### Final Advice
- Be as detailed as possible: even though the project is modular and relatively small, capturing the flow from request to action will help in validly representing how the ATM processes a transaction.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Presentation/Client Layer"
        A["AppSolicitud (Client)"]:::client
    end

    subgraph "Domain/Business Logic Layer"
        C["CajeroAutomatico (Controller)"]:::controller
        I["IManejador (Interface)"]:::interface
        subgraph "Bill Handlers (Chain-of-Responsibility)"
            B100["Billete100000"]:::handler
            B50["Billete50000"]:::handler
            B20["Billete20000"]:::handler
            B10["Billete10000"]:::handler
            B5["Billete5000"]:::handler
        end
    end

    A -->|"initiates"| C
    C -->|"delegatesTo"| B100
    B100 -->|"ifRemainder>0"| B50
    B50 -->|"ifRemainder>0"| B20
    B20 -->|"ifRemainder>0"| B10
    B10 -->|"ifRemainder>0"| B5

    B100 ---|"implements"| I
    B50 ---|"implements"| I
    B20 ---|"implements"| I
    B10 ---|"implements"| I
    B5 ---|"implements"| I

    click A "https://github.com/ruthv46/itm_ds_patron_cr/blob/main/src/AppSolicitud.java"
    click C "https://github.com/ruthv46/itm_ds_patron_cr/blob/main/src/dispensador/CajeroAutomatico.java"
    click I "https://github.com/ruthv46/itm_ds_patron_cr/blob/main/src/dispensador/IManejador.java"
    click B5 "https://github.com/ruthv46/itm_ds_patron_cr/blob/main/src/dispensador/Billete5000.java"
    click B10 "https://github.com/ruthv46/itm_ds_patron_cr/blob/main/src/dispensador/Billete10000.java"
    click B20 "https://github.com/ruthv46/itm_ds_patron_cr/blob/main/src/dispensador/Billete20000.java"
    click B50 "https://github.com/ruthv46/itm_ds_patron_cr/blob/main/src/dispensador/Billete50000.java"
    click B100 "https://github.com/ruthv46/itm_ds_patron_cr/blob/main/src/dispensador/Billete100000.java"

    classDef client fill:#F9E79F,stroke:#000,stroke-width:2px;
    classDef controller fill:#AED6F1,stroke:#000,stroke-width:2px;
    classDef interface fill:#F5B7B1,stroke:#000,stroke-width:2px;
    classDef handler fill:#D5F5E3,stroke:#000,stroke-width:2px;
```
