# raphaeltarita/multiplaform-metadata architecture

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

- Interactive diagram: https://gitdiagram.com/raphaeltarita/multiplaform-metadata
- Repository: https://github.com/raphaeltarita/multiplaform-metadata

## Overview

**[API Layer]**
- ↓
**[Implementation Layer]**
- ↓
**[Storage Layer]**

##### Detailed Component Breakdown

a) API Layer (Top):
- [Metadata] ← [TypedMetadata<T>]
- [NullableMetadata] ← [NullableTypedMetadata<T>]
- MetadataDelegate interface connecting to these core interfaces

b) Implementation Layer (Middle):
- [StandardMetadataImpl]
- [StandardTypedMetadataImpl]
- [StandardNullableMetadataImpl]
- [StandardNullableTypedMetadataImpl]
- [MetadataDelegateImpl]
- [TypedMetadataDelegateImpl]
- [NullableMetadataDelegateImpl]

c) Storage Layer (Bottom):
- [Type-Specific Maps]
- Bytes Map
- Shorts Map
- Ints Map
- etc.

##### Important Elements

- Blue: Core interfaces
- Green: Implementation classes
- Yellow: Storage components
- Red: Exception handling (UnknownIdentifierException)

**[Non-Null Values] → [Metadata]**
**[Null Values] → [NullableMetadata]**

**[Type Checking Layer]**
**↓**
**[Type-Specific Storage]**

**[Kotlin Property] ←→ [MetadataDelegate] ←→ [Storage]**

##### Additional Notes

- Notes about multiplatform compatibility
- Relationship between typed and nullable access paths

##### Implementation Details

**[Key (String)] → [Type Checker] → [Appropriate Storage Map]**

##### Error Handling

A small section showing:
**[Access Request] → [Type/Key Validation] → [UnknownIdentifierException]**

Remember to include a note about the multiplatform nature of the project, indicating that this architecture works across JVM, JS, and Native platforms.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Style Definitions
    classDef interface fill:#a8d1f0,stroke:#333
    classDef implementation fill:#90EE90,stroke:#333
    classDef storage fill:#FFE4B5,stroke:#333
    classDef error fill:#FFB6C1,stroke:#333
    classDef delegate fill:#DDA0DD,stroke:#333

    %% API Layer
    subgraph API
        M["Metadata"]
        TM["TypedMetadata<T>"]
        NM["NullableMetadata"]
        NTM["NullableTypedMetadata<T>"]
        MD["MetadataDelegate"]
    end

    %% Implementation Layer
    subgraph Implementation
        SMI["StandardMetadataImpl"]
        STMI["StandardTypedMetadataImpl"]
        SNMI["StandardNullableMetadataImpl"]
        SNTMI["StandardNullableTypedMetadataImpl"]
        
        MDI["MetadataDelegateImpl"]
        TMDI["TypedMetadataDelegateImpl"]
        NMDI["NullableMetadataDelegateImpl"]
    end

    %% Storage Layer
    subgraph Storage
        direction TB
        TSM["Type-Specific Maps"]
        BM["Bytes Map"]
        SM["Shorts Map"]
        IM["Ints Map"]
        FM["Fallback Map"]
    end

    %% Error Handling
    UIE["UnknownIdentifierException"]

    %% Relationships
    M --> TM
    M --> NM
    NM --> NTM
    TM --> NTM

    SMI -.-> M
    STMI -.-> TM
    SNMI -.-> NM
    SNTMI -.-> NTM

    MD --> SMI
    MD --> STMI
    MD --> SNMI
    MD --> SNTMI

    MDI -.-> MD
    TMDI -.-> MD
    NMDI -.-> MD

    SMI --> TSM
    STMI --> TSM
    SNMI --> TSM
    SNTMI --> TSM

    TSM --> BM
    TSM --> SM
    TSM --> IM
    TSM --> FM

    SMI --> UIE
    STMI --> UIE
    SNMI --> UIE
    SNTMI --> UIE

    %% Click Events
    click M "https://github.com/RaphaelTarita/multiplaform-metadata/blob/main/src/commonMain/kotlin/com/rtarita/metadata/Metadata.kt"
    click TM "https://github.com/RaphaelTarita/multiplaform-metadata/blob/main/src/commonMain/kotlin/com/rtarita/metadata/TypedMetadata.kt"
    click NM "https://github.com/RaphaelTarita/multiplaform-metadata/blob/main/src/commonMain/kotlin/com/rtarita/metadata/NullableMetadata.kt"
    click NTM "https://github.com/RaphaelTarita/multiplaform-metadata/blob/main/src/commonMain/kotlin/com/rtarita/metadata/NullableTypedMetadata.kt"
    click MD "https://github.com/RaphaelTarita/multiplaform-metadata/blob/main/src/commonMain/kotlin/com/rtarita/metadata/delegate/MetadataDelegate.kt"
    
    click SMI "https://github.com/RaphaelTarita/multiplaform-metadata/blob/main/src/commonMain/kotlin/com/rtarita/metadata/impl/StandardMetadataImpl.kt"
    click STMI "https://github.com/RaphaelTarita/multiplaform-metadata/blob/main/src/commonMain/kotlin/com/rtarita/metadata/impl/StandardTypedMetadataImpl.kt"
    click SNMI "https://github.com/RaphaelTarita/multiplaform-metadata/blob/main/src/commonMain/kotlin/com/rtarita/metadata/impl/StandardNullableMetadataImpl.kt"
    click SNTMI "https://github.com/RaphaelTarita/multiplaform-metadata/blob/main/src/commonMain/kotlin/com/rtarita/metadata/impl/StandardNullableTypedMetadataImpl.kt"
    
    click MDI "https://github.com/RaphaelTarita/multiplaform-metadata/blob/main/src/commonMain/kotlin/com/rtarita/metadata/delegate/MetadataDelegateImpl.kt"
    click TMDI "https://github.com/RaphaelTarita/multiplaform-metadata/blob/main/src/commonMain/kotlin/com/rtarita/metadata/delegate/TypedMetadataDelegateImpl.kt"
    click NMDI "https://github.com/RaphaelTarita/multiplaform-metadata/blob/main/src/commonMain/kotlin/com/rtarita/metadata/delegate/NullableMetadataDelegateImpl.kt"
    
    click UIE "https://github.com/RaphaelTarita/multiplaform-metadata/blob/main/src/commonMain/kotlin/com/rtarita/metadata/exc/UnknownIdentifierException.kt"

    %% Styling
    class M,TM,NM,NTM interface
    class SMI,STMI,SNMI,SNTMI implementation
    class TSM,BM,SM,IM,FM storage
    class UIE error
    class MD,MDI,TMDI,NMDI delegate
```
