# a-gubskiy/x.web.sitemap architecture

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

- Interactive diagram: https://gitdiagram.com/a-gubskiy/x.web.sitemap
- Repository: https://github.com/a-gubskiy/x.web.sitemap

## Overview

##### Main Components

a. Core Components:
- Sitemap Generator System
- Sitemap Index Generator System
- Serialization Layer
- File System Interface
- Domain Models

b. External Interfaces:
- Client Application Integration Point
- File System Output

**┌─ Client Integration Layer ─────────────────────┐**

- Public APIs (ISitemap, Generators)           │
- ┬───────────────────────────┘
- ↓
**┌─ Domain Layer ────────────────────────────────┐**

- Models (Url, Image, SitemapInfo)             │
- Enums (ChangeFrequency)                      │
- ┬───────────────────────────┘
- ↓
**┌─ Core Services Layer ──────────────────────────┐**

- SitemapGenerator                             │
- SitemapIndexGenerator                        │
- ┬───────────────────────────┘
- ↓
**┌─ Serialization Layer ─────────────────────────┐**

- SitemapSerializer                            │
- SitemapIndexSerializer                       │
- ┬───────────────────────────┘
- ↓
**┌─ Infrastructure Layer ────────────────────────┐**

- FileSystemWrapper                            │
- XML Management                               │
- ┘

##### Important Relationships to Highlight

- How SitemapGenerator depends on SitemapSerializer
- Relationship between Sitemap and SitemapIndex
- Demonstrate how FileSystemWrapper abstracts file system operations
- Extension methods enhancing core functionality

##### Key Architectural Patterns to Emphasize

- Interface-based design (ISitemap)
- Separation of concerns (Generators vs. Serializers)
- Extension-based functionality
- Factory pattern for sitemap generation

##### Implementation Details

- Key public methods
- Important properties
- Relationships with other components

For example:
**┌─ SitemapGenerator ─────────┐**

- GenerateSitemaps()      │
- SaveToDirectory()       │

- ┬───────────────┘
- ↓
**┌─ SitemapSerializer ───────┐**

- Serialize()             │
- Deserialize()           │

- ┘

##### Integration Points

How the library integrates with:
- File system for output
- XML manipulation
- Client applications

Remember to maintain a balance between detail and clarity, focusing on the core functionality of sitemap generation and management while showing the extensibility points and integration capabilities of the library.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef interface fill:#a8d1f0,stroke:#333
    classDef implementation fill:#90EE90,stroke:#333
    classDef model fill:#FFE5B4,stroke:#333
    classDef infrastructure fill:#E6E6E6,stroke:#333
    classDef layer fill:#f9f9f9,stroke:#333,stroke-dasharray: 5 5

    subgraph ClientLayer["Client Integration Layer"]
        ISitemap["ISitemap Interface"]:::interface
        Examples["Example Implementations"]:::implementation
    end

    subgraph DomainLayer["Domain Layer"]
        Url["Url Model"]:::model
        Image["Image Model"]:::model
        SitemapInfo["SitemapInfo Model"]:::model
        ChangeFrequency["ChangeFrequency Enum"]:::model
        Sitemap["Sitemap"]:::implementation
        SitemapIndex["SitemapIndex"]:::implementation
    end

    subgraph CoreLayer["Core Services Layer"]
        SitemapGenerator["SitemapGenerator"]:::implementation
        SitemapIndexGenerator["SitemapIndexGenerator"]:::implementation
    end

    subgraph SerializationLayer["Serialization Layer"]
        SitemapSerializer["SitemapSerializer"]:::implementation
        SitemapIndexSerializer["SitemapIndexSerializer"]:::implementation
    end

    subgraph InfraLayer["Infrastructure Layer"]
        FileSystemWrapper["FileSystemWrapper"]:::infrastructure
        XmlDocumentExtension["XmlDocumentExtension"]:::infrastructure
        StringWriterUtf8["StringWriterUtf8"]:::infrastructure
        SitemapExtension["SitemapExtension"]:::infrastructure
        SitemapIndexExtension["SitemapIndexExtension"]:::infrastructure
    end

    %% Relationships
    ISitemap --> Sitemap
    ISitemap --> SitemapIndex
    Sitemap --> Url
    Sitemap --> Image
    SitemapIndex --> SitemapInfo
    Url --> ChangeFrequency
    SitemapGenerator --> SitemapSerializer
    SitemapIndexGenerator --> SitemapIndexSerializer
    SitemapSerializer --> FileSystemWrapper
    SitemapIndexSerializer --> FileSystemWrapper
    FileSystemWrapper --> XmlDocumentExtension
    FileSystemWrapper --> StringWriterUtf8
    Sitemap --> SitemapExtension
    SitemapIndex --> SitemapIndexExtension

    %% Click Events
    click ISitemap "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/ISitemap.cs"
    click Examples "https://github.com/a-gubskiy/X.Web.Sitemap/tree/master/examples/X.Web.Sitemap.Example/Examples"
    click Url "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/Url.cs"
    click Image "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/Image.cs"
    click SitemapInfo "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/SitemapInfo.cs"
    click ChangeFrequency "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/ChangeFrequency.cs"
    click Sitemap "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/Sitemap.cs"
    click SitemapIndex "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/SitemapIndex.cs"
    click SitemapGenerator "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/Generators/SitemapGenerator.cs"
    click SitemapIndexGenerator "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/Generators/SitemapIndexGenerator.cs"
    click SitemapSerializer "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/Serializers/SitemapSerializer.cs"
    click SitemapIndexSerializer "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/Serializers/SitemapIndexSerializer.cs"
    click FileSystemWrapper "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/FileSystemWrapper.cs"
    click XmlDocumentExtension "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/Extensions/XmlDocumentExtension.cs"
    click StringWriterUtf8 "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/StringWriterUtf8.cs"
    click SitemapExtension "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/Extensions/SitemapExtension.cs"
    click SitemapIndexExtension "https://github.com/a-gubskiy/X.Web.Sitemap/blob/master/src/X.Web.Sitemap/Extensions/SitemapIndexExtension.cs"
```
