# victorsndvg/fpl architecture

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

- Interactive diagram: https://gitdiagram.com/victorsndvg/fpl
- Repository: https://github.com/victorsndvg/fpl

## Overview

##### Main Components

a. Core Components:
- ParameterList Module
- Parameter Entry System
- Wrapper System
- Factory System
- Iterator System

b. Data Type Support Layer:
- Dimension Wrappers (0D to 7D)
- Type-specific Wrappers (Integer, Real, Logical, String)
- Factory implementations for each type

**┌─────────────────────────────────────────────────────┐**
- Client Interface                    │
- (FPL Module - Public API Interface)          │
- ┤
- Parameter Management                   │
- ┬─────────────────┬──────────────────┤
- ParameterList │  ParameterEntry │    Iterator      │
- System     │     System      │     System       │
- ┴─────────────────┴──────────────────┤
- Wrapper Factory System                 │
- ┤
- Dimension Wrappers                    │
- ┬─────┬─────┬─────┬─────┬─────┬─────┬─────────┤
- 0D  │ 1D  │ 2D  │ 3D  │ 4D  │ 5D  │ 6D  │  7D    │
- ┴─────┴─────┴─────┴─────┴─────┴─────┴─────────┘

##### Component Relationships

- Inheritance relationships between wrapper types
- Factory creation flows
- Data flow between components
- Dependency relationships

##### Key Design Elements to Highlight

a. Factory Pattern Implementation:
**┌─────────────────┐     ┌─────────────────┐**
- WrapperFactory  │────▶│ Concrete        │
- (Abstract)      │     │ Type Factories  │
- ┘     └─────────────────┘

b. Parameter List Structure:
**┌─────────────────┐     ┌─────────────────┐**
- ParameterList  │────▶│ ParameterEntry  │
- Dictionary      │
- ┘     └─────────────────┘

##### Implementation Details

Specialized components for:
- Different numeric types (I1P, I2P, I4P, I8P, R4P, R8P)
- Logical types
- Character types
- Multi-dimensional arrays

##### Notes for the Engineer

- Keep the abstraction level appropriate for a system overview while showing the key architectural patterns
- Factory pattern and type system
- Extensibility points for adding new types
- Recursive nature of parameter lists
- Error handling flow

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef interface fill:#2196F3,stroke:#1565C0,color:white
    classDef core fill:#4CAF50,stroke:#388E3C,color:white
    classDef factory fill:#FFC107,stroke:#FFA000,color:black
    classDef wrapper fill:#FF9800,stroke:#F57C00,color:white
    classDef support fill:#9E9E9E,stroke:#616161,color:white

    %% Client Interface Layer
    ClientInterface["FPL Module<br/>(Public API)"]:::interface
    click ClientInterface "https://github.com/victorsndvg/FPL/blob/master/src/lib/FPL.f90"

    %% Parameter Management Layer
    subgraph ParamManagement["Parameter Management"]
        ParameterList["Parameter List"]:::core
        ParameterEntry["Parameter Entry"]:::core
        ParameterDict["Parameter Entry<br/>Dictionary"]:::core
        RootEntry["Root Entry"]:::core
        Iterator["Iterator System"]:::core
    end
    click ParameterList "https://github.com/victorsndvg/FPL/blob/master/src/lib/ParameterList.f90"
    click ParameterEntry "https://github.com/victorsndvg/FPL/blob/master/src/lib/ParameterEntry.f90"
    click ParameterDict "https://github.com/victorsndvg/FPL/blob/master/src/lib/ParameterEntryDictionary.f90"
    click RootEntry "https://github.com/victorsndvg/FPL/blob/master/src/lib/ParameterRootEntry.f90"

    %% Factory System Layer
    subgraph FactorySystem["Wrapper Factory System"]
        WrapperFactory["Wrapper Factory<br/>(Abstract)"]:::factory
        FactoryList["Factory List"]:::factory
        FactoryListSingleton["Factory List<br/>Singleton"]:::factory
    end
    click WrapperFactory "https://github.com/victorsndvg/FPL/blob/master/src/lib/Wrapper/WrapperFactory/WrapperFactory.f90"
    click FactoryList "https://github.com/victorsndvg/FPL/blob/master/src/lib/Wrapper/WrapperFactoryList.f90"
    click FactoryListSingleton "https://github.com/victorsndvg/FPL/blob/master/src/lib/Wrapper/WrapperFactoryListSingleton.f90"

    %% Type-specific Factories
    subgraph TypeFactories["Type-specific Factories"]
        I1PFactory["I1P Factory"]:::factory
        I2PFactory["I2P Factory"]:::factory
        I4PFactory["I4P Factory"]:::factory
        I8PFactory["I8P Factory"]:::factory
        R4PFactory["R4P Factory"]:::factory
        R8PFactory["R8P Factory"]:::factory
        LFactory["Logical Factory"]:::factory
        DLACFactory["DLAC Factory"]:::factory
    end
    click I1PFactory "https://github.com/victorsndvg/FPL/blob/master/src/lib/Wrapper/WrapperFactory/I1PWrapperFactory.f90"
    click I2PFactory "https://github.com/victorsndvg/FPL/blob/master/src/lib/Wrapper/WrapperFactory/I2PWrapperFactory.f90"
    click I4PFactory "https://github.com/victorsndvg/FPL/blob/master/src/lib/Wrapper/WrapperFactory/I4PWrapperFactory.f90"
    click I8PFactory "https://github.com/victorsndvg/FPL/blob/master/src/lib/Wrapper/WrapperFactory/I8PWrapperFactory.f90"
    click R4PFactory "https://github.com/victorsndvg/FPL/blob/master/src/lib/Wrapper/WrapperFactory/R4PWrapperFactory.f90"
    click R8PFactory "https://github.com/victorsndvg/FPL/blob/master/src/lib/Wrapper/WrapperFactory/R8PWrapperFactory.f90"
    click LFactory "https://github.com/victorsndvg/FPL/blob/master/src/lib/Wrapper/WrapperFactory/LWrapperFactory.f90"
    click DLACFactory "https://github.com/victorsndvg/FPL/blob/master/src/lib/Wrapper/WrapperFactory/DLACWrapperFactory.f90"

    %% Dimension Wrappers
    subgraph DimensionWrappers["Dimension Wrappers"]
        DimBase["Dimensions Wrapper<br/>(Base)"]:::wrapper
        Dim0D["0D Wrapper"]:::wrapper
        Dim1D["1D Wrapper"]:::wrapper
        Dim2D["2D Wrapper"]:::wrapper
        Dim3D["3D Wrapper"]:::wrapper
        Dim4D["4D Wrapper"]:::wrapper
        Dim5D["5D Wrapper"]:::wrapper
        Dim6D["6D Wrapper"]:::wrapper
        Dim7D["7D Wrapper"]:::wrapper
    end
    click DimBase "https://github.com/victorsndvg/FPL/blob/master/src/lib/Wrapper/DimensionsWrapper.f90"
    click Dim0D "https://github.com/victorsndvg/FPL/tree/master/src/lib/Wrapper/DimensionsWrapper0D"
    click Dim1D "https://github.com/victorsndvg/FPL/tree/master/src/lib/Wrapper/DimensionsWrapper1D"
    click Dim2D "https://github.com/victorsndvg/FPL/tree/master/src/lib/Wrapper/DimensionsWrapper2D"
    click Dim3D "https://github.com/victorsndvg/FPL/tree/master/src/lib/Wrapper/DimensionsWrapper3D"
    click Dim4D "https://github.com/victorsndvg/FPL/tree/master/src/lib/Wrapper/DimensionsWrapper4D"
    click Dim5D "https://github.com/victorsndvg/FPL/tree/master/src/lib/Wrapper/DimensionsWrapper5D"
    click Dim6D "https://github.com/victorsndvg/FPL/tree/master/src/lib/Wrapper/DimensionsWrapper6D"
    click Dim7D "https://github.com/victorsndvg/FPL/tree/master/src/lib/Wrapper/DimensionsWrapper7D"

    %% Support Components
    ErrorHandler["Error Handler"]:::support
    Utils["Utility Functions"]:::support
    click ErrorHandler "https://github.com/victorsndvg/FPL/blob/master/src/lib/ErrorMessages.f90"
    click Utils "https://github.com/victorsndvg/FPL/blob/master/src/lib/FPL_utils.f90"

    %% Relationships
    ClientInterface --> ParameterList
    ParameterList --> ParameterEntry
    ParameterEntry --> ParameterDict
    ParameterDict --> RootEntry
    ParameterList --> Iterator

    WrapperFactory --> TypeFactories
    FactoryList --> WrapperFactory
    FactoryListSingleton --> FactoryList

    DimBase --> Dim0D & Dim1D & Dim2D & Dim3D & Dim4D & Dim5D & Dim6D & Dim7D
    TypeFactories --> DimensionWrappers

    ErrorHandler -.-> ClientInterface
    Utils -.-> ClientInterface
```
