# lsb530/boki-kotlin-practice architecture

> Architecture diagram of the GitHub repository lsb530/boki-kotlin-practice, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lsb530/boki-kotlin-practice
- Repository: https://github.com/lsb530/boki-kotlin-practice

## Overview

##### Project Type & Purpose
- Type: Multi-module educational code repository
- Purpose: Provide Kotlin (and Java) practice exercises at Basic and Expert levels, plus coroutine tutorials and JMH benchmarks.

##### High-Level Components
– Gradle Wrapper & Configuration
- gradlew, gradlew.bat, gradle/wrapper, build.gradle.kts, settings.gradle.kts, gradle.properties
– Sub-modules:
1. jmh-benchmark module
2. main source module
- Java exercises (src/main/java)
- Kotlin exercises (src/main/kotlin)
3. test module (src/test/kotlin)

##### Break Down the Main Module
A. Java Basic & Expert
– Path: src/main/java
– Packages: basic/lec01…lec17, expert/c_function
B. Kotlin Basic
– Path: src/main/kotlin/basic
– Packages: a_variable_and_type_operator, b_code_control, c_oop, d_fp, e_etc_and_scope
C. Kotlin Coroutine
– Path: src/main/kotlin/coroutine
– Packages: basic, builder, cancel, context, continuation, ex, scope, spread, suspend, util
D. Kotlin Expert
– Path: src/main/kotlin/expert
– Packages: a_generic, b_delegate, c_function, d_dsl, e_reflection, f_extra

##### Dependencies & Interactions
- The “test module” depends on the “main source module” (to run unit tests on expert delegates).
- There is no runtime interaction between Java and Kotlin code here—they coexist under the same JVM classpath but are separate exercise groups.

##### Architectural Patterns & Principles
– Multi-module Gradle structure (separation of concerns).
– Layering by skill level: Basic → Expert → Coroutine.
– Code organization by topic/lecture.
– Benchmarking layer (JMH) orthogonal to exercise code.

##### Essential Elements
– Clear labels for:
- Gradle wrapper/config
- jmh-benchmark module
- main/java exercises
- main/kotlin exercises (basic, coroutine, expert)
- test module

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Kotlin Practice Repo (Gradle Project)"
        subgraph "Gradle Wrapper & Configuration"
            GC["Gradle Wrapper & Configuration"]:::build
        end
        subgraph "jmh-benchmark module"
            JMH["jmh-benchmark"]:::benchmark
        end
        subgraph "Main Source Module"
            MAIN["Main Source Module"]:::module
            subgraph "Java Basic & Expert"
                Java["Java Basic & Expert"]:::java
            end
            subgraph "Kotlin Basic Exercises"
                KB["Kotlin Basic Exercises"]:::kotlin
            end
            subgraph "Kotlin Coroutine Tutorials"
                CO["Kotlin Coroutine Tutorials"]:::kotlin
            end
            subgraph "Kotlin Expert Exercises"
                KE["Kotlin Expert Exercises"]:::kotlin
            end
        end
        subgraph "Test Module"
            TEST["Test Module"]:::test
        end
    end

    GC -->|orchestrates build| JMH
    GC -->|orchestrates build| MAIN
    GC -->|orchestrates build| TEST
    JMH -->|depends on| MAIN
    TEST -->|depends on| MAIN

    click GC "https://github.com/lsb530/boki-kotlin-practice/blob/main/settings.gradle.kts"
    click JMH "https://github.com/lsb530/boki-kotlin-practice/tree/main/src/jmh/"
    click Java "https://github.com/lsb530/boki-kotlin-practice/tree/main/src/main/java/basic/"
    click KB "https://github.com/lsb530/boki-kotlin-practice/tree/main/src/main/kotlin/basic/"
    click CO "https://github.com/lsb530/boki-kotlin-practice/tree/main/src/main/kotlin/coroutine/"
    click KE "https://github.com/lsb530/boki-kotlin-practice/tree/main/src/main/kotlin/expert/"
    click TEST "https://github.com/lsb530/boki-kotlin-practice/blob/main/src/test/kotlin/expert/b_delegate/PersonTest1.kt"

    classDef build fill:#dddddd,stroke:#333,stroke-width:1px;
    classDef benchmark fill:#ccffcc,stroke:#333,stroke-width:1px;
    classDef module fill:#f9f9f9,stroke:#333,stroke-width:1px;
    classDef java fill:#cce5ff,stroke:#333,stroke-width:1px;
    classDef kotlin fill:#e5ccff,stroke:#333,stroke-width:1px;
    classDef test fill:#ccffcc,stroke:#333,stroke-width:1px;
```
