# bjornbakke/solid architecture

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

- Interactive diagram: https://gitdiagram.com/bjornbakke/solid
- Repository: https://github.com/bjornbakke/solid

## Overview

##### Project Overview
- The entire repository is structured as a multi-module Maven project. The top-level project (named “SOLID”) serves as the container, and each subdirectory (e.g., decoratorPattern, dependencyInversionPrinciple, finiteStateMachinePattern, etc.) represents an independent module showcasing a specific design pattern or principle.
- The primary purpose is educational: to provide example implementations of key design concepts (such as the Decorator Pattern, Dependency Inversion Principle, Finite State Machine Pattern, Liskov Substitution Principle, Open/Closed Principle, Specification Pattern, Strategy Pattern using Enums, Tell-Don’t Ask, Template Pattern, and usage of Generics).

##### Main Components
- Parent Container: Represent the overall SOLID project as the high-level container or “umbrella” project.
- Individual Modules: Each module should be illustrated as a separate component/block:
- decoratorPattern
- dependencyInversionPrinciple
- finiteStateMachinePattern
- liskovsSubstitutionPrinciple
- openClosedPrinciple
- specificationPattern
- strategyPatternUsingEnums
- tellDontAsk
- templatePattern
- generics
- Each module contains its own source packages, mostly organized under standard Maven directories (src/main/java). Though you do not need to detail every class, note a couple of the sub-packages (e.g., “com/eniro/productmaster” in the decoratorPattern module) can be mentioned as examples if needed.

##### Relationships and Interactions
- Since these modules are designed to be standalone demonstrations of different patterns, emphasize their independence. They are not necessarily interacting with one another directly; instead, the common relationship is with the parent project.
- However, you might want to show the shared dependencies such as the Maven build system and the common usage of Java (JDK 11+).
- That each module’s functionality (e.g., order entry, customer data, state management) is encapsulated and illustrates a particular design principle.

##### Architectural Patterns and Technologies
- Use of design patterns: for instance, how the decoratorPattern module uses both base classes and decorator classes, and similarly how specificationPattern features abstract and composite specifications.
- Clear segregation of concerns in each module which aligns with SOLID principles.
- Mention that the project uses Maven for build management, ensuring that each module is correctly compiled, tested, and executed independently.
- Fact that the project is structured following standard Java package conventions along with a proper modular design that adheres to clean code principles (as encouraged by the SOLID principles).

## Diagram (Mermaid)

```mermaid
graph TD
    SOLID_Project["SOLID Project (Multi-Module Maven Project)"]:::parent
    Maven_Build["Maven Build System"]:::build

    SOLID_Project -->|"provides build configuration"| Maven_Build

    subgraph "Modules"
        DP["decoratorPattern (Decorator Pattern)"]:::module
        DIP["dependencyInversionPrinciple (Dependency Inversion Principle)"]:::module
        FSM["finiteStateMachinePattern (Finite State Machine Pattern)"]:::module
        LSP["liskovsSubstitutionPrinciple (Liskov Substitution Principle)"]:::module
        OCP["openClosedPrinciple (Open/Closed Principle)"]:::module
        SP["specificationPattern (Specification Pattern)"]:::module
        SPE["strategyPatternUsingEnums (Strategy Pattern using Enums)"]:::module
        TDA["tellDontAsk (Tell-Don't Ask)"]:::module
        TP["templatePattern (Template Pattern)"]:::module
        GEN["generics (Usage of Generics)"]:::module
    end

    Maven_Build -->|"builds"| DP
    Maven_Build -->|"builds"| DIP
    Maven_Build -->|"builds"| FSM
    Maven_Build -->|"builds"| LSP
    Maven_Build -->|"builds"| OCP
    Maven_Build -->|"builds"| SP
    Maven_Build -->|"builds"| SPE
    Maven_Build -->|"builds"| TDA
    Maven_Build -->|"builds"| TP
    Maven_Build -->|"builds"| GEN

    %% Click Events
    click SOLID_Project "https://github.com/bjornbakke/solid/blob/master/."
    click DP "https://github.com/bjornbakke/solid/tree/master/decoratorPattern/"
    click DIP "https://github.com/bjornbakke/solid/tree/master/dependencyInversionPrinciple/"
    click FSM "https://github.com/bjornbakke/solid/tree/master/finiteStateMachinePattern/"
    click LSP "https://github.com/bjornbakke/solid/tree/master/liskovsSubstitutionPrinciple/"
    click OCP "https://github.com/bjornbakke/solid/tree/master/openClosedPrinciple/"
    click SP "https://github.com/bjornbakke/solid/tree/master/specificationPattern/"
    click SPE "https://github.com/bjornbakke/solid/tree/master/strategyPatternUsingEnums/"
    click TDA "https://github.com/bjornbakke/solid/tree/master/tellDontAsk/"
    click TP "https://github.com/bjornbakke/solid/tree/master/templatePattern/"
    click GEN "https://github.com/bjornbakke/solid/tree/master/generics/"

    %% Styles
    classDef parent fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef build fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef module fill:#ABEBC6,stroke:#1E8449,stroke-width:2px;
```
