# ofkira/hello-java architecture

> Architecture diagram of the GitHub repository ofkira/hello-java, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ofkira/hello-java
- Repository: https://github.com/ofkira/hello-java

## Overview

1. **Repository purpose**
   - This is a **Java fundamentals teaching repository**, not a production application.
   - Its architecture is organized as a **sequence of independent lesson modules** that build from basic syntax to OOP, exceptions, and miscellaneous topics.

2. **Top-level structure**
   - The repo is centered under `basic/`, with chapter folders `c00_...` through `c10_...`.
   - `Images/` contains static assets for the README/course presentation.
   - There is no visible backend, frontend, database, or service orchestration layer; the “system” is the **course content itself**.

3. **Course progression as the main dependency chain**
   - The folders form a **linear curriculum**:
     - `c00_helloworld` → first program and first exercises
     - `c01_beginner` → variables, constants, primitive types
     - `c02_operators` → operators
     - `c03_strings` → string APIs
     - `c04_conditionals` → branching
     - `c05_structures` → arrays, lists, sets, maps
     - `c06_loops` → iteration and loop control
     - `c07_functions` → methods, parameters, return values, overloads
     - `c08_oop` → object-oriented design
     - `c09_exceptions` → error handling and custom exceptions
     - `c10_extras` → miscellaneous Java features
   - For diagramming, the important boundary is that **each chapter is mostly self-contained**, but the curriculum flow is sequential.

4. **Content pattern inside each chapter**
   - Most lesson folders contain one or more **concept demonstration classes** plus a matching `*Exercises.java`.
   - This creates two distinct content paths:
     - **instructional examples** (`HelloWorld.java`, `Operators.java`, `Strings.java`, etc.)
     - **practice problems** (`HelloWorldExercises.java`, `OperatorsExercises.java`, etc.)
   - The exercises are not a separate subsystem; they are the practice counterpart to the instructional code.

5. **Core language fundamentals subsystem**
   - The early chapters (`c00`–`c07`) focus on **imperative programming fundamentals**:
     - syntax and program entry
     - data types and variables
     - expressions and operators
     - string manipulation
     - conditionals
     - collections and iteration
     - reusable functions
   - These chapters demonstrate standard Java library usage, but only at the level needed to teach the language basics.

6. **Data structures and control flow**
   - `c05_structures` groups the basic collection abstractions: `Arrays`, `Lists`, `Sets`, and `Maps`.
   - `c06_loops` covers the main iteration patterns and loop-control flow.
   - Architecturally, these chapters are the bridge between “syntax” and “program logic,” showing how data moves through loops and collections.

7. **OOP subsystem**
   - `c08_oop` is the largest architectural block and introduces object-oriented concepts:
     - `Classes.java` and `Person.java` show class/object modeling
     - `AccessModifiers.java` and `basic/c08_test_oop/Classes.java` demonstrate package-level access boundaries
     - `Inheritance.java`, `Polymorphism.java`, `Abstraction.java`, and `Composition.java` show the main OOP relationships
   - This is the first part of the repo where **multiple classes collaborate** in a more realistic object model.

8. **Boundary-testing package**
   - `basic/c08_test_oop/Classes.java` exists specifically to test or demonstrate **access modifier behavior across a different package**.
   - That folder is important in an architecture diagram because it represents a **visibility boundary**, not just another example file.

9. **Exception-handling subsystem**
   - `c09_exceptions` isolates runtime failure handling:
     - `Exceptions.java` for try/catch-style handling
     - `ThrowExample.java` for explicit exception throwing
     - `CustomException.java` for domain-specific exception types
     - `ExceptionsExercises.java` for practice
   - The key architectural idea here is the separation between **normal control flow** and **error flow**.

10. **Extras and wrap-up**
   - `c10_extras` collects additional Java topics that don’t fit the main progression.
   - `Extras.java`, `ExtrasExample.java`, and `ExtrasExercises.java` again follow the same lesson/exercise split.
   - This acts as a catch-all extension layer rather than a distinct subsystem.

11. **Runtime and tooling context**
   - The repo targets **Java JDK 21+** per the README.
   - There is no obvious build automation or dependency management visible in the tree, which suggests the code is meant to be run directly in an IDE or simple Java project setup.
   - That means the repo architecture is primarily **educational source organization**, not deployable infrastructure.

12. **How to draw it**
   - A good architecture diagram would show:
     - a single top-level “Java course” system
     - a **chapter-by-chapter pipeline** from fundamentals to OOP and exceptions
     - each chapter containing **example classes** and **exercise classes**
     - a small shared “support” area for classes like `Person`, `CustomException`, and the access-modifier test package
   - The main boundary is between **curriculum modules** and the **readme/media assets**, not between services or tiers.

Main entry points: [`basic/c08_oop`](https://github.com/ofkira/hello-java/tree/main/basic/c08_oop) (OOP), [`basic/c09_exceptions`](https://github.com/ofkira/hello-java/tree/main/basic/c09_exceptions) (Exceptions), [`basic/c01_beginner`](https://github.com/ofkira/hello-java/tree/main/basic/c01_beginner) (Beginner), [`basic/c02_operators`](https://github.com/ofkira/hello-java/tree/main/basic/c02_operators) (Operators)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_docs_assets["Docs & assets"]
  node_readme["README<br/>documentation<br/>[README.md]"]
  node_images["Images<br/>assets"]
end

subgraph group_curriculum["Curriculum"]
  node_course["Java course<br/>curriculum root"]
  node_c00["Hello world<br/>chapter"]
  node_c01["Beginner<br/>chapter"]
  node_c02["Operators<br/>chapter"]
  node_c03["Strings<br/>chapter"]
  node_c04["Conditionals<br/>chapter"]
  node_c05["Structures<br/>chapter"]
  node_c06["Loops<br/>chapter"]
  node_c07["Functions<br/>chapter"]
  node_c08["OOP<br/>chapter"]
  node_c09["Exceptions<br/>chapter"]
  node_c10["Extras<br/>chapter"]
end

subgraph group_oop["OOP internals"]
  node_oop_classes["Classes<br/>oop example<br/>[Classes.java]"]
  node_oop_person["Person<br/>oop model<br/>[Person.java]"]
  node_oop_access["Access<br/>oop example"]
  node_oop_boundary["Test package<br/>visibility boundary<br/>[Classes.java]"]
  node_oop_relationships["Relationships<br/>oop concepts"]
end

subgraph group_exceptions["Exception internals"]
  node_exceptions_core["Exceptions<br/>error handling<br/>[Exceptions.java]"]
  node_exceptions_throw["Throwing<br/>error handling<br/>[ThrowExample.java]"]
  node_exceptions_custom["Custom error<br/>exception type"]
end

node_readme -->|"describes"| node_course
node_course -->|"starts with"| node_c00
node_c00 -->|"next"| node_c01
node_c01 -->|"next"| node_c02
node_c02 -->|"next"| node_c03
node_c03 -->|"next"| node_c04
node_c04 -->|"next"| node_c05
node_c05 -->|"next"| node_c06
node_c06 -->|"next"| node_c07
node_c07 -->|"next"| node_c08
node_c08 -->|"next"| node_c09
node_c09 -->|"next"| node_c10
node_c00 -.->|"practices"| node_c01
node_c01 -.->|"practices"| node_c02
node_c02 -.->|"practices"| node_c03
node_c03 -.->|"practices"| node_c04
node_c04 -.->|"practices"| node_c05
node_c05 -.->|"practices"| node_c06
node_c06 -.->|"practices"| node_c07
node_c07 -.->|"practices"| node_c08
node_c08 -->|"introduces"| node_oop_classes
node_oop_classes -->|"uses"| node_oop_person
node_c08 -->|"covers"| node_oop_access
node_oop_access -.->|"checks"| node_oop_boundary
node_c08 -->|"covers"| node_oop_relationships
node_c09 -->|"introduces"| node_exceptions_core
node_exceptions_core -->|"extends"| node_exceptions_throw
node_exceptions_core -->|"defines"| node_exceptions_custom
node_c09 -.->|"exercises"| node_exceptions_custom

click node_readme "https://github.com/ofkira/hello-java/blob/main/README.md"
click node_images "https://github.com/ofkira/hello-java/tree/main/Images"
click node_course "https://github.com/ofkira/hello-java/tree/main/basic"
click node_c00 "https://github.com/ofkira/hello-java/tree/main/basic/c00_helloworld"
click node_c01 "https://github.com/ofkira/hello-java/tree/main/basic/c01_beginner"
click node_c02 "https://github.com/ofkira/hello-java/tree/main/basic/c02_operators"
click node_c03 "https://github.com/ofkira/hello-java/tree/main/basic/c03_strings"
click node_c04 "https://github.com/ofkira/hello-java/tree/main/basic/c04_conditionals"
click node_c05 "https://github.com/ofkira/hello-java/tree/main/basic/c05_structures"
click node_c06 "https://github.com/ofkira/hello-java/tree/main/basic/c06_loops"
click node_c07 "https://github.com/ofkira/hello-java/tree/main/basic/c07_functions"
click node_c08 "https://github.com/ofkira/hello-java/tree/main/basic/c08_oop"
click node_c09 "https://github.com/ofkira/hello-java/tree/main/basic/c09_exceptions"
click node_c10 "https://github.com/ofkira/hello-java/tree/main/basic/c10_extras"
click node_oop_classes "https://github.com/ofkira/hello-java/blob/main/basic/c08_oop/Classes.java"
click node_oop_person "https://github.com/ofkira/hello-java/blob/main/basic/c08_oop/Person.java"
click node_oop_access "https://github.com/ofkira/hello-java/blob/main/basic/c08_oop/AccessModifiers.java"
click node_oop_boundary "https://github.com/ofkira/hello-java/blob/main/basic/c08_test_oop/Classes.java"
click node_oop_relationships "https://github.com/ofkira/hello-java/tree/main/basic/c08_oop"
click node_exceptions_core "https://github.com/ofkira/hello-java/blob/main/basic/c09_exceptions/Exceptions.java"
click node_exceptions_throw "https://github.com/ofkira/hello-java/blob/main/basic/c09_exceptions/ThrowExample.java"
click node_exceptions_custom "https://github.com/ofkira/hello-java/blob/main/basic/c09_exceptions/CustomException.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_readme,node_images toneBlue
class node_course,node_c00,node_c01,node_c02,node_c03,node_c04,node_c05,node_c06,node_c07,node_c08,node_c09,node_c10 toneAmber
class node_oop_classes,node_oop_person,node_oop_access,node_oop_boundary,node_oop_relationships toneMint
class node_exceptions_core,node_exceptions_throw,node_exceptions_custom toneRose
```

## Components

### Docs & assets

Repository documentation and static presentation assets.

- [README](https://github.com/ofkira/hello-java/blob/main/README.md): documentation · Course overview and usage notes. · `README.md`
- [Images](https://github.com/ofkira/hello-java/tree/main/Images): assets · Static course images and illustrations. · `Images`

### Curriculum

Linear Java lesson chapters from fundamentals to extras.

- [Java course](https://github.com/ofkira/hello-java/tree/main/basic): curriculum root · Top-level teaching repository organized as a sequential chapter flow. · `basic`
- [Hello world](https://github.com/ofkira/hello-java/tree/main/basic/c00_helloworld): chapter · First program and first exercises. · `basic/c00_helloworld`
- [Beginner](https://github.com/ofkira/hello-java/tree/main/basic/c01_beginner): chapter · Variables, constants, and primitive types. · `basic/c01_beginner`
- [Operators](https://github.com/ofkira/hello-java/tree/main/basic/c02_operators): chapter · Expressions and operators. · `basic/c02_operators`
- [Strings](https://github.com/ofkira/hello-java/tree/main/basic/c03_strings): chapter · String APIs and manipulation. · `basic/c03_strings`
- [Conditionals](https://github.com/ofkira/hello-java/tree/main/basic/c04_conditionals): chapter · Branching and decision-making. · `basic/c04_conditionals`
- [Structures](https://github.com/ofkira/hello-java/tree/main/basic/c05_structures): chapter · Arrays, lists, sets, and maps. · `basic/c05_structures`
- [Loops](https://github.com/ofkira/hello-java/tree/main/basic/c06_loops): chapter · Iteration and loop control. · `basic/c06_loops`
- [Functions](https://github.com/ofkira/hello-java/tree/main/basic/c07_functions): chapter · Methods, parameters, return values, and overloads. · `basic/c07_functions`
- [OOP](https://github.com/ofkira/hello-java/tree/main/basic/c08_oop): chapter · Classes, relationships, and access boundaries. · `basic/c08_oop`
- [Exceptions](https://github.com/ofkira/hello-java/tree/main/basic/c09_exceptions): chapter · Try/catch handling and custom exceptions. · `basic/c09_exceptions`
- [Extras](https://github.com/ofkira/hello-java/tree/main/basic/c10_extras): chapter · Miscellaneous Java topics and wrap-up. · `basic/c10_extras`

### OOP internals

Object-oriented modeling and visibility-boundary examples inside chapter 08.

- [Classes](https://github.com/ofkira/hello-java/blob/main/basic/c08_oop/Classes.java): oop example · Class and object modeling. · `basic/c08_oop/Classes.java`
- [Person](https://github.com/ofkira/hello-java/blob/main/basic/c08_oop/Person.java): oop model · Shared domain object used by OOP examples. · `basic/c08_oop/Person.java`
- [Access](https://github.com/ofkira/hello-java/blob/main/basic/c08_oop/AccessModifiers.java): oop example · Access modifier behavior within the package. · `basic/c08_oop/AccessModifiers.java`
- [Test package](https://github.com/ofkira/hello-java/blob/main/basic/c08_test_oop/Classes.java): visibility boundary · Cross-package access test for modifier behavior. · `basic/c08_test_oop/Classes.java`
- [Relationships](https://github.com/ofkira/hello-java/tree/main/basic/c08_oop): oop concepts · Inheritance, polymorphism, abstraction, and composition. · `basic/c08_oop`

### Exception internals

Normal-flow and error-flow examples inside chapter 09.

- [Exceptions](https://github.com/ofkira/hello-java/blob/main/basic/c09_exceptions/Exceptions.java): error handling · Normal exception handling flow. · `basic/c09_exceptions/Exceptions.java`
- [Throwing](https://github.com/ofkira/hello-java/blob/main/basic/c09_exceptions/ThrowExample.java): error handling · Explicit exception throwing examples. · `basic/c09_exceptions/ThrowExample.java`
- [Custom error](https://github.com/ofkira/hello-java/blob/main/basic/c09_exceptions/CustomException.java): exception type · Domain-specific exception definition. · `basic/c09_exceptions/CustomException.java`

## Connections

- README → Java course: describes · Documentation frames the course structure.
- Java course → Hello world: starts with · Curriculum begins with the first runnable program.
- Hello world → Beginner: next · Fundamentals progress into variables and primitive types.
- Beginner → Operators: next · Types and variables feed into expressions and operators.
- Operators → Strings: next · Operators lead into string manipulation.
- Strings → Conditionals: next · String handling precedes branching logic.
- Conditionals → Structures: next · Conditional logic bridges to collections and structured data.
- Structures → Loops: next · Collections are exercised with iteration patterns.
- Loops → Functions: next · Looping sets up reusable functions and decomposition.
- Functions → OOP: next · Procedural basics transition into object-oriented design.
- OOP → Exceptions: next · OOP fundamentals lead into error handling.
- Exceptions → Extras: next · Exception handling is followed by extra topics.
- Hello world → Beginner: practices · Each chapter pairs explanation with exercises.
- Beginner → Operators: practices · Each chapter pairs explanation with exercises.
- Operators → Strings: practices · Each chapter pairs explanation with exercises.
- Strings → Conditionals: practices · Each chapter pairs explanation with exercises.
- Conditionals → Structures: practices · Each chapter pairs explanation with exercises.
- Structures → Loops: practices · Each chapter pairs explanation with exercises.
- Loops → Functions: practices · Each chapter pairs explanation with exercises.
- Functions → OOP: practices · Each chapter pairs explanation with exercises.
- OOP → Classes: introduces · Core OOP chapter starts with class modeling.
- Classes → Person: uses · Class examples collaborate with a person model.
- OOP → Access: covers · Access modifiers are taught as a dedicated topic.
- Access → Test package: checks · A separate package demonstrates visibility boundaries.
- OOP → Relationships: covers · Inheritance, polymorphism, abstraction, and composition are grouped together.
- Exceptions → Exceptions: introduces · Exception handling begins with try/catch flow.
- Exceptions → Throwing: extends · Explicit throwing shows how failures propagate.
- Exceptions → Custom error: defines · Custom exception types support domain-specific failures.
- Exceptions → Custom error: exercises · Practice work reinforces exception handling concepts.
