# forax/design-pattern-reloaded architecture

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

- Interactive diagram: https://gitdiagram.com/forax/design-pattern-reloaded
- Repository: https://github.com/forax/design-pattern-reloaded

## Overview

##### Main Components

a) Core Design Pattern Categories
- Creational Patterns (Abstract Factory, Builder, Factory)
- Structural Patterns (Adapter, Decorator)
- Behavioral Patterns (Chain of Responsibility, Command, Observer, State, Template Method, Visitor)
- Modern Patterns (Memoizer, Monad, Railway Switch)
- Type System Patterns (Dynamic Typing, Structural Typing, Subtyping)

##### Relationship Representations

Relationships between patterns using:

##### Implementation Details

A section showing:
- Java 21 as the implementation language
- Test directory structure
- README documentation for each pattern
- Individual pattern implementations (shown as nested components)

##### Implementation Details Layer

- Individual .java files for each pattern
- Testing infrastructure
- Build and CI/CD components

- High-level pattern categorization
- Implementation details
- Pattern relationships
- Educational/reference nature of the project

Remember to include notes about:
- Java 21 specific features
- Delegation over inheritance emphasis
- Immutability considerations
- Pattern variations and modern interpretations

This will create a comprehensive visualization that serves both as a reference architecture and an educational tool for understanding design pattern implementations in modern Java.

## Diagram (Mermaid)

```mermaid
graph TB
    classDef creational fill:#e1f5fe,stroke:#01579b
    classDef structural fill:#e8f5e9,stroke:#1b5e20
    classDef behavioral fill:#fff3e0,stroke:#e65100
    classDef modern fill:#f3e5f5,stroke:#4a148c
    classDef typeSystem fill:#eceff1,stroke:#263238
    classDef core fill:#fff,stroke:#000
    classDef docs fill:#fafafa,stroke:#424242

    DPR["Design Patterns Reloaded"]:::core

    subgraph Build
        Maven["Maven Build System"]
        CICD["GitHub Actions CI/CD"]
    end
    click Maven "https://github.com/forax/design-pattern-reloaded/blob/master/pom.xml"
    click CICD "https://github.com/forax/design-pattern-reloaded/blob/master/.github/workflows/maven.yml"

    DPR --> Build

    subgraph Creational["Creational Patterns"]
        AF["Abstract Factory"]:::creational
        B["Builder"]:::creational
        F["Factory"]:::creational
    end
    click AF "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/abstractfactory/"
    click B "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/builder/"
    click F "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/factory/"

    subgraph Structural["Structural Patterns"]
        A["Adapter"]:::structural
        D["Decorator"]:::structural
    end
    click A "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/adapter/"
    click D "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/decorator/"

    subgraph Behavioral["Behavioral Patterns"]
        CR["Chain of Responsibility"]:::behavioral
        C["Command"]:::behavioral
        O["Observer"]:::behavioral
        S["State"]:::behavioral
        TM["Template Method"]:::behavioral
        V["Visitor"]:::behavioral
    end
    click CR "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/chainofresponsibility/"
    click C "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/command/"
    click O "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/observer/"
    click S "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/state/"
    click TM "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/templatemethod/"
    click V "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/visitor/"

    subgraph Modern["Modern Patterns"]
        M["Memoizer"]:::modern
        MN["Monad"]:::modern
        RS["Railway Switch"]:::modern
    end
    click M "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/memoizer/"
    click MN "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/monad/"
    click RS "https://github.com/forax/design-pattern-reloaded/tree/master/src/main/java/railwayswitch/"

    subgraph TypeSystem["Type System Patterns"]
        DT["Dynamic Typing"]:::typeSystem
        ST["Structural Typing"]:::typeSystem
        SBT["Subtyping"]:::typeSystem
    end
    click DT "https://github.com/forax/design-pattern-reloaded/blob/master/src/main/java/typing/dynamictyping.java"
    click ST "https://github.com/forax/design-pattern-reloaded/blob/master/src/main/java/typing/structuraltyping.java"
    click SBT "https://github.com/forax/design-pattern-reloaded/blob/master/src/main/java/typing/subtyping.java"

    DPR --> Creational
    DPR --> Structural
    DPR --> Behavioral
    DPR --> Modern
    DPR --> TypeSystem

    subgraph Documentation
        MD["Main Documentation"]:::docs
        PD["Pattern Documentation"]:::docs
    end
    click MD "https://github.com/forax/design-pattern-reloaded/blob/master/README.md"
    click PD "https://github.com/forax/design-pattern-reloaded/blob/master/src/main/java/*/README.md"

    DPR --> Documentation

    %% Pattern Relationships
    D -.-> A
    V -.-> ST
    AF -.-> F

    %% Legend
    subgraph Legend
        L1["Creational Pattern"]:::creational
        L2["Structural Pattern"]:::structural
        L3["Behavioral Pattern"]:::behavioral
        L4["Modern Pattern"]:::modern
        L5["Type System Pattern"]:::typeSystem
        L6["Core Component"]:::core
        L7["Documentation"]:::docs
    end
```
