# wesleyegberto/java-new-features architecture

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

- Interactive diagram: https://gitdiagram.com/wesleyegberto/java-new-features
- Repository: https://github.com/wesleyegberto/java-new-features

## Overview

1. **Repository purpose and shape**
   - This is a **feature showcase / learning monorepo** for Java platform evolution, not a single application.
   - The top level is organized by **JDK release** (`java-7` through `java-27`) plus two dedicated project areas (`projects/loom`, `projects/valhalla`).
   - The main architectural boundary is **version isolation**: each folder contains examples that are meant to compile and run against that specific Java release or preview/incubator feature set.

2. **Primary execution model**
   - Most examples are **small standalone programs** or tests, each demonstrating one feature in isolation.
   - There is very little cross-version or cross-folder coupling; each directory acts like its own mini-lab.
   - This means the repo’s architecture is best drawn as a **collection of independent demo modules**, rather than a layered product with shared services.

3. **Build and tooling boundaries**
   - **Java 8** is the main Maven-based subproject (`java-8/pom.xml`, `src/main/java/...`).
   - Later versions rely mostly on **single-file/source-file examples** and version-specific scripts such as `build.sh`.
   - The repo intentionally spans multiple Java compiler/runtime modes: stable releases, **preview features**, incubators, and experimental APIs. That version-specific execution requirement is a core architectural concern.

4. **Java 8 as the baseline feature suite**
   - `java-8` is a conventional package hierarchy under `com.github.wesleyegberto`.
   - It groups examples by language/API theme: lambdas, streams, collections, base64, datetime, validation, interfaces, method references, and reductions.
   - This folder provides the “legacy baseline” against which later language and platform changes are contrasted.

5. **Java 9: modularity and services**
   - `java-9/modules` is the first clearly modular subsystem, showing **JPMS** architecture.
   - It contains separate modules for:
     - `services/provider`
     - `services/consumer`
     - `simple_deps` split into `math_api`, `math_lib`, and `calculator`
   - The architecture here demonstrates **module boundaries, service provision/consumption, and dependency encapsulation**, with shell scripts for building and launching module graphs.

6. **Java 9+ platform/API feature labs**
   - `java-9/others-features` and `java-10`/`java-11`/`java-12`/... are mostly **topic-focused demo suites** rather than systems.
   - Examples cover collections improvements, process API, reactive flow, HTTP client, streams, futures, and compact collections.
   - The data flow is typically local and in-memory, with occasional interaction with the host process or external endpoints.

7. **Networking and external interaction examples**
   - `java-11` contains the clearest network-facing cluster: HTTP GET/POST, async/reactive HTTP client usage, and a reusable `HttpBinRequestBuilder`.
   - `java-18/SimpleWebServer.java` and its static `index.html`/`img` assets form a tiny **embedded web server + static content** demo.
   - These examples are isolated from the rest of the repo and usually interact with external services only for demonstration purposes, not as persistent dependencies.

8. **Concurrency evolution track**
   - From `java-12` onward, concurrency examples progress from `CompletableFuture` to **virtual threads**, **structured concurrency**, and **scoped values** in later versions.
   - `java-19`, `java-20`, `java-21`, `java-24`, and `java-25` contain the densest concurrency material.
   - The architectural theme is the shift from **thread-per-request / platform-thread stress tests** to **virtual-thread-based workloads** and structured task grouping.
   - Several `java-19` stress programs and the JMX file suggest performance/load experimentation around thread scaling.

9. **Language-model evolution track**
   - A large portion of the repo demonstrates changes to the Java type system and syntax:
     - records
     - sealed classes/interfaces
     - pattern matching for `instanceof` and `switch`
     - text blocks
     - flexible constructors
     - unnamed/implicitly declared classes and main methods
     - string templates
     - sequenced collections
   - These samples are generally self-contained and show how newer syntax changes application structure, especially around data carriers and branching logic.

10. **Native and low-level runtime integration**
   - `java-22/person_validator.c` alongside FFM examples shows **Java-to-native interop** using the Foreign Function & Memory API.
   - `java-24/ClassFileApi*` demonstrates **class-file reading/writing/transformation**, which is a lower-level bytecode boundary distinct from normal source-level code.
   - `java-14/JFREventStreamTest.java` and `java-25/ProfilingTest.java` point to runtime observability and profiling experiments.

11. **Advanced platform/runtime features**
   - Several folders cover JVM/runtime changes that affect deployment or execution model:
     - packaging tool / runtime image work
     - Unix domain sockets
     - value-based class warnings
     - stable/lazy constants
     - final-field mutation and primitive pattern previews
   - These are not application subsystems; they are **runtime behavior probes** showing how the platform itself changes across versions.

12. **Experimental project areas**
   - `projects/loom` is a focused set of Loom prototypes around **virtual threads and thread counting/execution**.
   - `projects/valhalla` contains early experiments with **primitive/value classes and records**.
   - These folders are conceptually separate from the versioned examples: they act as **forward-looking R&D tracks** for upcoming platform work.

13. **Typical data flow pattern**
   - Most programs follow a simple flow: **construct example inputs → invoke a Java API or language feature → print/assert results**.
   - A smaller subset crosses boundaries:
     - HTTP client examples call external endpoints.
     - FFM examples call native C code.
     - JPMS service demos resolve provider/consumer relationships at runtime.
     - Stress tests exercise the scheduler/runtime under load.
   - There is no central database, queue, or shared domain model.

14. **How to diagram this repo accurately**
   - Draw it as a **versioned gallery of independent demo subsystems**.
   - Show a few key cross-cutting categories rather than one application stack:
     - language features
     - collections/streams/API updates
     - modularity/services
     - concurrency/runtime
     - native interop
     - observability/tooling
   - Emphasize that **JDK version is the primary organizing axis** and that each folder is a self-contained boundary with its own compile/run assumptions.

Main entry points: [`java-8`](https://github.com/wesleyegberto/java-new-features/tree/master/java-8) (Java 8), [`java-15`](https://github.com/wesleyegberto/java-new-features/tree/master/java-15) (Java 15-17), [`java-19`](https://github.com/wesleyegberto/java-new-features/tree/master/java-19) (Java 19), [`java-23`](https://github.com/wesleyegberto/java-new-features/tree/master/java-23) (Java 23)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_baseline["Baseline"]
  node_java7["Java 7<br/>versioned demos"]
  node_java8["Java 8<br/>maven suite"]
end

subgraph group_modularity["Modularity"]
  node_java9mod["JPMS modules<br/>module demos"]
  node_java9feat["Java 9 labs<br/>API demos"]
end

subgraph group_features["Feature labs"]
  node_java10_14["Java 10-14<br/>feature demos"]
  node_java11["Java 11<br/>http demos"]
  node_java12_14["Java 12-14<br/>language demos"]
  node_java15_17["Java 15-17<br/>syntax demos"]
  node_java18["Java 18<br/>embedded server"]
end

subgraph group_concurrency["Concurrency"]
  node_concurrency19["Java 19<br/>stress and concurrency"]
  node_concurrency20_21["Java 20-21<br/>concurrency evolution"]
end

subgraph group_advanced["Advanced runtime"]
  node_java22["Java 22<br/>ffm and gatherers"]
  node_java23["Java 23<br/>runtime demos"]
  node_java24["Java 24<br/>runtime internals"]
  node_java25["Java 25<br/>runtime labs"]
  node_java26_27["Java 26-27<br/>preview labs"]
end

subgraph group_projects["Projects"]
  node_loom["Loom<br/>prototype"]
  node_valhalla["Valhalla<br/>prototype"]
end

node_java7 -->|"baseline evolves"| node_java8
node_java8 -->|"modularity"| node_java9mod
node_java9mod -->|"platform APIs"| node_java9feat
node_java9feat -->|"versioned demos"| node_java10_14
node_java10_14 -->|"networking"| node_java11
node_java11 -->|"language changes"| node_java12_14
node_java12_14 -->|"type system"| node_java15_17
node_java15_17 -->|"runtime demo"| node_java18
node_java18 -->|"concurrency focus"| node_concurrency19
node_concurrency19 -->|"virtual threads"| node_concurrency20_21
node_concurrency20_21 -->|"new APIs"| node_java22
node_java22 -->|"preview features"| node_java23
node_java23 -->|"internals"| node_java24
node_java24 -->|"observability"| node_java25
node_java25 -->|"latest previews"| node_java26_27
node_java8 -.->|"forward look"| node_loom
node_java15_17 -.->|"forward look"| node_valhalla
node_concurrency19 -.->|"prototype overlap"| node_loom
node_java23 -.->|"value types"| node_valhalla

click node_java7 "https://github.com/wesleyegberto/java-new-features/tree/master/java-7"
click node_java8 "https://github.com/wesleyegberto/java-new-features/tree/master/java-8"
click node_java9mod "https://github.com/wesleyegberto/java-new-features/tree/master/java-9/modules"
click node_java9feat "https://github.com/wesleyegberto/java-new-features/tree/master/java-9/others-features"
click node_java10_14 "https://github.com/wesleyegberto/java-new-features/tree/master/java-10"
click node_java11 "https://github.com/wesleyegberto/java-new-features/tree/master/java-11"
click node_java12_14 "https://github.com/wesleyegberto/java-new-features/tree/master/java-12"
click node_java15_17 "https://github.com/wesleyegberto/java-new-features/tree/master/java-15"
click node_java18 "https://github.com/wesleyegberto/java-new-features/tree/master/java-18"
click node_concurrency19 "https://github.com/wesleyegberto/java-new-features/tree/master/java-19"
click node_concurrency20_21 "https://github.com/wesleyegberto/java-new-features/tree/master/java-20"
click node_loom "https://github.com/wesleyegberto/java-new-features/tree/master/projects/loom"
click node_java22 "https://github.com/wesleyegberto/java-new-features/tree/master/java-22"
click node_java23 "https://github.com/wesleyegberto/java-new-features/tree/master/java-23"
click node_java24 "https://github.com/wesleyegberto/java-new-features/tree/master/java-24"
click node_java25 "https://github.com/wesleyegberto/java-new-features/tree/master/java-25"
click node_java26_27 "https://github.com/wesleyegberto/java-new-features/tree/master/java-26"
click node_valhalla "https://github.com/wesleyegberto/java-new-features/tree/master/projects/valhalla"

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_java7,node_java8 toneBlue
class node_java9mod,node_java9feat toneAmber
class node_java10_14,node_java11,node_java12_14,node_java15_17,node_java18 toneMint
class node_concurrency19,node_concurrency20_21 toneRose
class node_java22,node_java23,node_java24,node_java25,node_java26_27 toneIndigo
class node_loom,node_valhalla toneTeal
```

## Components

### Baseline

Java 7/8 feature baseline and conventional Maven subproject.

- [Java 7](https://github.com/wesleyegberto/java-new-features/tree/master/java-7): versioned demos · TransferQueue example for the Java 7 baseline. · `java-7`
- [Java 8](https://github.com/wesleyegberto/java-new-features/tree/master/java-8): maven suite · Baseline Maven project with lambdas, streams, APIs, and model examples. · `java-8`

### Modularity

Java 9 JPMS and service/dependency demos.

- [JPMS modules](https://github.com/wesleyegberto/java-new-features/tree/master/java-9/modules): module demos · Services and simple dependency graphs built around module boundaries. · `java-9/modules`
- [Java 9 labs](https://github.com/wesleyegberto/java-new-features/tree/master/java-9/others-features): API demos · Collections, process API, reactive flow, and HTTP client examples. · `java-9/others-features`

### Feature labs

Versioned language/API examples from Java 10 through 18.

- [Java 10-14](https://github.com/wesleyegberto/java-new-features/tree/master/java-10): feature demos · Collections, process API, text blocks, records, pattern matching, packaging, and JFR. · `java-10`
- [Java 11](https://github.com/wesleyegberto/java-new-features/tree/master/java-11): http demos · HTTP client and request builder examples plus pipe-stream usage. · `java-11`
- [Java 12-14](https://github.com/wesleyegberto/java-new-features/tree/master/java-12): language demos · Teeing collectors, switch expressions, compact numbers, records, and helpful NPEs. · `java-12`
- [Java 15-17](https://github.com/wesleyegberto/java-new-features/tree/master/java-15): syntax demos · Sealed types, record variants, Unix domain sockets, PRNG, and pattern matching. · `java-15`
- [Java 18](https://github.com/wesleyegberto/java-new-features/tree/master/java-18): embedded server · Simple web server, JavaDoc snippets, and preview pattern matching. · `java-18`

### Concurrency

Concurrency evolution from futures to virtual threads and structured concurrency.

- [Java 19](https://github.com/wesleyegberto/java-new-features/tree/master/java-19): stress and concurrency · Platform-thread and virtual-thread stress tests plus structured concurrency motivation. · `java-19`
- [Java 20-21](https://github.com/wesleyegberto/java-new-features/tree/master/java-20): concurrency evolution · Scoped values, structured concurrency, virtual threads, string templates, and sequenced collections. · `java-20`

### Advanced runtime

Later release features around low-level runtime, class files, and platform APIs.

- [Java 22](https://github.com/wesleyegberto/java-new-features/tree/master/java-22): ffm and gatherers · Foreign Function & Memory API, multi-file source launching, and stream gatherers. · `java-22`
- [Java 23](https://github.com/wesleyegberto/java-new-features/tree/master/java-23): runtime demos · Flexible constructors, implicitly declared classes, primitive patterns, and scoped values. · `java-23`
- [Java 24](https://github.com/wesleyegberto/java-new-features/tree/master/java-24): runtime internals · Class-file API reading, writing, transforming, module imports, and virtual-thread synchronization. · `java-24`
- [Java 25](https://github.com/wesleyegberto/java-new-features/tree/master/java-25): runtime labs · Profiling, stable values, structured concurrency, scoped values, and implicitly declared classes. · `java-25`
- [Java 26-27](https://github.com/wesleyegberto/java-new-features/tree/master/java-26): preview labs · Final-field mutation, lazy constants, primitive patterns, and PEM encoding examples. · `java-26`

### Projects

Forward-looking Loom and Valhalla experiments.

- [Loom](https://github.com/wesleyegberto/java-new-features/tree/master/projects/loom): prototype · Virtual-thread prototypes focused on execution and thread counting. · `projects/loom`
- [Valhalla](https://github.com/wesleyegberto/java-new-features/tree/master/projects/valhalla): prototype · Primitive/value class and record experiments. · `projects/valhalla`

## Connections

- Java 7 → Java 8: baseline evolves · The repo starts with Java 7 and then establishes Java 8 as the main baseline suite.
- Java 8 → JPMS modules: modularity · Java 9 introduces explicit module boundaries and services.
- JPMS modules → Java 9 labs: platform APIs · Java 9 also broadens the feature-lab style with collections, process, reactive, and HTTP demos.
- Java 9 labs → Java 10-14: versioned demos · Later release examples continue as isolated release-specific feature programs.
- Java 10-14 → Java 11: networking · Java 11 concentrates the HTTP client and request-builder examples.
- Java 11 → Java 12-14: language changes · The demo set shifts toward newer syntax and language features.
- Java 12-14 → Java 15-17: type system · Records, sealed types, and pattern matching become the main language-evolution track.
- Java 15-17 → Java 18: runtime demo · Java 18 adds the embedded web server and preview pattern matching examples.
- Java 18 → Java 19: concurrency focus · From Java 19 onward the repo emphasizes threading, stress tests, and structured concurrency.
- Java 19 → Java 20-21: virtual threads · Virtual threads and scoped values expand the concurrency track in Java 20-21.
- Java 20-21 → Java 22: new APIs · Java 22 extends the runtime track with FFM and stream gatherers.
- Java 22 → Java 23: preview features · The later release folders continue with runtime and syntax previews.
- Java 23 → Java 24: internals · Java 24 moves into class-file tooling and module import declarations.
- Java 24 → Java 25: observability · Java 25 adds profiling and further concurrency/runtime experiments.
- Java 25 → Java 26-27: latest previews · Java 26-27 show the newest preview/runtime changes.
- Java 8 → Loom: forward look · Loom prototypes explore the virtual-thread direction beyond the baseline examples.
- Java 15-17 → Valhalla: forward look · Valhalla prototypes explore primitive/value classes beyond standard releases.
- Java 19 → Loom: prototype overlap · The Loom project mirrors the repo's virtual-thread and execution-model experiments.
- Java 23 → Valhalla: value types · Valhalla aligns with primitive and value-class experimentation in later releases.
