# gilgoldzweig/gencycler architecture

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

- Interactive diagram: https://gitdiagram.com/gilgoldzweig/gencycler
- Repository: https://github.com/gilgoldzweig/gencycler

## Overview

##### Main Components

a) Core Components:
- Annotations Module
- Compiler Module
- Gencycler Runtime Module
- Sample Module (for demonstration)

b) Processing Flow Components:
- Annotation Processor
- Code Generators
- XML Parser
- File Helpers

**┌─ Development Time ─────────────────────────────────────────────┐**

- ┌─ Annotations ─┐    ┌─ Compiler ────────────────────────┐  │
- @GencyclerAdapter│    │ ┌─ Processor ─┐  ┌─ Generators ─┐ │  │
- @ViewHolder   │    │ │             │  │              │ │  │
- @Clickable    │ ─> │ │  Annotation │  │  ViewHolder  │ │  │
- @Filterable   │    │ │  Processor  │─>│  Adapter     │ │  │
- ┘    │ │             │  │              │ │  │
- ┘  └──────────────┘ │  │
- ▲                ▼         │  │
- ┌──────┴─────┐  ┌──────────────┐ │  │
- XML     │  │    Models    │ │  │
- Parser   │  │              │ │  │
- ┘  └──────────────┘ │  │
- ┘  │

- ┘

**┌─ Runtime ──────────────────────────────────────────────────┐**

- ┌─ Generated Code ─┐    ┌─ Gencycler Library ────────┐  │

- Adapter Classes │<───│    Base Classes            │  │
- ViewHolders     │    │    Helper Utilities        │  │
- Event Handlers          │  │
- ┘    └────────────────────────────┘  │

- ┘

##### Key Elements to Highlight

- The annotation processing pipeline
- The code generation process
- The runtime component integration
- The separation between compile-time and runtime components

##### Additional Notes

- Notes about the compile-time vs runtime distinction
- Version/compatibility information

##### Implementation Details

- Use standard UML notation where appropriate
- Keep the abstraction level high enough to understand the system flow
- Important interfaces and abstract classes
- Relationship with Android's RecyclerView system

Remember to include the key features mentioned in the README (click listeners, multi-view types, filtering, etc.) as part of the runtime library components, showing how they integrate with the generated code.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef annotations fill:#3498db,stroke:#2980b9,color:white
    classDef compiler fill:#2ecc71,stroke:#27ae60,color:white
    classDef runtime fill:#e67e22,stroke:#d35400,color:white
    classDef generated fill:#f1c40f,stroke:#f39c12,color:black
    classDef utils fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Development Time Section
    subgraph DevelopmentTime["Development Time"]
        %% Annotations Module
        subgraph Annotations
            GAdapter["@GencyclerAdapter"]
            VHolder["@ViewHolder"]
            Clickable["@Clickable"]
            Filterable["@Filterable"]
        end

        %% Compiler Module
        subgraph Compiler
            subgraph Processor
                AP["Annotation Processor"]
            end

            subgraph Generators
                VHGen["ViewHolder Generator"]
                AdapterGen["Adapter Generator"]
            end

            subgraph Utils
                XMLParser["XML Parser"]
                FileHelpers["File Helpers"]
                Models["Code Models"]
            end
        end
    end

    %% Runtime Section
    subgraph Runtime["Runtime"]
        subgraph GeneratedCode["Generated Code"]
            GenAdapter["Generated Adapters"]
            GenViewHolder["Generated ViewHolders"]
        end

        subgraph Library["Gencycler Library"]
            BaseClasses["Base Classes"]
            EventHandlers["Event Handlers"]
            FilterComponent["Filter Component"]
        end
    end

    %% Relationships
    GAdapter & VHolder & Clickable & Filterable --> AP
    AP --> VHGen & AdapterGen
    XMLParser --> AP
    FileHelpers --> AP
    VHGen & AdapterGen --> Models
    Models --> GenAdapter & GenViewHolder
    GenAdapter & GenViewHolder --> BaseClasses
    BaseClasses --> EventHandlers
    BaseClasses --> FilterComponent

    %% Click Events
    click Annotations "https://github.com/gilgoldzweig/Gencycler/tree/master//annotations/src/main/java/goldzweigapps/com/annotations/annotations/"
    click Compiler "https://github.com/gilgoldzweig/Gencycler/tree/master//compiler/src/main/java/goldzweigapps/com/compiler/"
    click AP "https://github.com/gilgoldzweig/Gencycler/blob/master//compiler/src/main/java/goldzweigapps/com/compiler/GencyclerProcessor.kt"
    click Generators "https://github.com/gilgoldzweig/Gencycler/tree/master//compiler/src/main/java/goldzweigapps/com/compiler/generators/"
    click XMLParser "https://github.com/gilgoldzweig/Gencycler/blob/master//compiler/src/main/java/goldzweigapps/com/compiler/parser/XMLParser.kt"
    click FileHelpers "https://github.com/gilgoldzweig/Gencycler/blob/master//compiler/src/main/java/goldzweigapps/com/compiler/utils/FileHelper.kt"
    click EventHandlers "https://github.com/gilgoldzweig/Gencycler/tree/master//gencycler/src/main/java/goldzweigapps/com/gencycler/listeners/"
    click BaseClasses "https://github.com/gilgoldzweig/Gencycler/blob/master//gencycler/src/main/java/goldzweigapps/com/gencycler/GencyclerHolder.kt"
    click FilterComponent "https://github.com/gilgoldzweig/Gencycler/blob/master//gencycler/src/main/java/goldzweigapps/com/gencycler/filter/GencyclerFilter.kt"
    click Library "https://github.com/gilgoldzweig/Gencycler/tree/master//gencycler/src/main/java/goldzweigapps/com/gencycler/"

    %% Style Applications
    class GAdapter,VHolder,Clickable,Filterable annotations
    class AP,VHGen,AdapterGen,XMLParser,FileHelpers,Models compiler
    class BaseClasses,EventHandlers,FilterComponent runtime
    class GenAdapter,GenViewHolder generated
    class XMLParser,FileHelpers utils
```
