# hb4305/dictionary architecture

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

- Interactive diagram: https://gitdiagram.com/hb4305/dictionary
- Repository: https://github.com/hb4305/dictionary

## Overview

##### Project type and purpose
- This is a standalone Java “Slang Dictionary” application implementing a three-layer architecture (UI, business logic, data access).
- Its purpose is to load, query, quiz, and manage “slang” entries from local data files.

##### File structure
- Top-level files:
- Main.java — application entry point.
- README.md — project overview.
- DICTIONARY.jar — built executable.
- data/ — contains raw slang data files (slang.txt, slang_of_the_day.txt, binary “.dat”).
- models/SlangEntry.java — domain model for a single slang entry.
- services/
- bussiness/ — business-logic components (SlangDictionary, Quiz, SlangOfTheDayServices, SlangParser, Factory, IParsable).
- dataaccess/ — DAO interfaces and implementations (IDao, TextDao, BinaryDao).
- ui/Mainapp.java — user-interface layer (console or simple GUI launcher).

##### README for additional insights
- Confirms three main packages: models, services (bussiness & dataaccess), ui.
- No external services (purely local files).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% UI Layer
    subgraph "UI Layer"
        direction TB
        Main["Main (Entry Point)"]:::ui
        UIApp["Mainapp (UI)"]:::ui
    end

    %% Business Layer
    subgraph "Business Layer"
        direction TB
        Dict["SlangDictionary"]:::business
        Quiz["Quiz"]:::business
        SOTD["SlangOfTheDayServices"]:::business
        Parser["SlangParser"]:::business
        Factory["Factory"]:::business
        IParse["IParsable"]:::interface
    end

    %% Model
    subgraph "Model"
        direction TB
        Entry["SlangEntry"]:::model
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        direction TB
        IDao["IDao<T>"]:::interface
        TextDao["TextDao"]:::dataaccess
        BinaryDao["BinaryDao"]:::dataaccess
    end

    %% Data Store
    subgraph "Data Store"
        direction TB
        TxtFile["slang.txt"]:::datastore
        DatFile["slang.dat"]:::datastore
        SOTDFile["slang_of_the_day.txt"]:::datastore
    end

    %% Connections
    Main --> UIApp
    UIApp -->|calls| Dict
    UIApp -->|calls| Quiz
    UIApp -->|calls| SOTD

    Dict -->|uses| Factory
    Quiz -->|uses| Factory
    SOTD -->|uses| Factory

    Dict -->|parses| Parser
    Parser -->|implements| IParse
    Factory -->|creates| IParse

    Factory -->|creates| IDao
    IDao -->|implemented by| TextDao
    IDao -->|implemented by| BinaryDao

    TextDao -->|reads/writes| TxtFile
    BinaryDao -->|reads/writes| DatFile
    SOTD -->|reads/writes| SOTDFile

    TextDao -->|returns| Entry
    BinaryDao -->|returns| Entry
    Dict -->|returns| Entry
    Quiz -->|uses| Entry
    SOTD -->|uses| Entry

    %% Click Events
    click Main "https://github.com/hb4305/dictionary/blob/main/Main.java"
    click UIApp "https://github.com/hb4305/dictionary/blob/main/ui/Mainapp.java"
    click Entry "https://github.com/hb4305/dictionary/blob/main/models/SlangEntry.java"
    click Dict "https://github.com/hb4305/dictionary/blob/main/services/bussiness/SlangDictionary.java"
    click Quiz "https://github.com/hb4305/dictionary/blob/main/services/bussiness/Quiz.java"
    click SOTD "https://github.com/hb4305/dictionary/blob/main/services/bussiness/SlangOfTheDayServices.java"
    click Parser "https://github.com/hb4305/dictionary/blob/main/services/bussiness/SlangParser.java"
    click Factory "https://github.com/hb4305/dictionary/blob/main/services/bussiness/Factory.java"
    click IParse "https://github.com/hb4305/dictionary/blob/main/services/bussiness/IParsable.java"
    click IDao "https://github.com/hb4305/dictionary/blob/main/services/dataaccess/IDao.java"
    click TextDao "https://github.com/hb4305/dictionary/blob/main/services/dataaccess/TextDao.java"
    click BinaryDao "https://github.com/hb4305/dictionary/blob/main/services/dataaccess/BinaryDao.java"
    click TxtFile "https://github.com/hb4305/dictionary/blob/main/data/slang.txt"
    click DatFile "https://github.com/hb4305/dictionary/blob/main/data/slang.dat"
    click SOTDFile "https://github.com/hb4305/dictionary/blob/main/data/slang_of_the_day.txt"
    click README "https://github.com/hb4305/dictionary/blob/main/README.md"
    click JAR "https://github.com/hb4305/dictionary/blob/main/DICTIONARY.jar"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#3399ff
    classDef business fill:#d4edda,stroke:#28a745
    classDef dataaccess fill:#fff3cd,stroke:#ffc107
    classDef datastore fill:#e2e3e5,stroke:#6c757d
    classDef interface stroke-dasharray: 5 5,stroke:#343a40,fill:#f8f9fa
    classDef model fill:#f0f0f0,stroke:#6c757d
```
