# jbloch/effective-java-3e-source-code architecture

> Architecture diagram of the GitHub repository jbloch/effective-java-3e-source-code, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jbloch/effective-java-3e-source-code
- Repository: https://github.com/jbloch/effective-java-3e-source-code

## Overview

This repository is a collection of Java examples accompanying Effective Java, Third Edition, not a single application. Readers can browse independent examples of object construction, class design, generics, enums and annotations, lambdas and streams, API design, concurrency, and serialization. There is no repository-wide user-to-result workflow: each example demonstrates a focused technique. The graph highlights those topic areas and the sampled relationships that are explicit in source; chapter-level nodes use exact directories where individual implementations were not sampled.

Main entry points: [`src/effectivejava/chapter11/item79/ObservableSet.java`](https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter11/item79/ObservableSet.java) (Observable set), [`src/effectivejava/chapter8`](https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter8) (API usage examples), [`src/effectivejava/chapter11/item83/Initialization.java`](https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter11/item83/Initialization.java) (Lazy initialization), [`src/effectivejava/chapter12/item85/DeserializationBomb.java`](https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter12/item85/DeserializationBomb.java) (Deserialization example)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_objects["Objects and APIs"]
  node_builders["Object builders"]
  node_resource["Resource handling"]
  node_equality["Equality and ordering"]
  node_phoneclone["Phone cloning<br/>[PhoneNumber.java]"]
  node_immutable["Immutable values"]
  node_api["API design examples"]
end

subgraph group_types["Types and Generics"]
  node_generics["Generic types"]
  node_annotations["Annotations and tests"]
end

subgraph group_functional["Enums and Functional"]
  node_enum["Enum patterns"]
  node_lambdas["Lambdas and streams"]
  node_apiusage["API usage examples"]
end

subgraph group_concurrency["Concurrency"]
  node_observable["Observable set<br/>[ObservableSet.java]"]
  node_observers["Set observer<br/>[SetObserver.java]"]
  node_forwarding["Forwarding set<br/>[ForwardingSet.java]"]
  node_initialization["Lazy initialization"]
  node_fieldtype["Field value type<br/>[FieldType.java]"]
end

subgraph group_serialization["Serialization"]
  node_serialization["Serialization utilities<br/>[Util.java]"]
  node_bomb["Deserialization example"]
end

node_observable -->|"extends"| node_forwarding
node_observable -->|"notifies"| node_observers
node_initialization -->|"creates"| node_fieldtype
node_bomb -->|"serializes and deserializes"| node_serialization
node_apiusage -->|"references"| node_api

click node_builders "https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter2/item2"
click node_resource "https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter2/item9"
click node_equality "https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter3/item10"
click node_phoneclone "https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter3/item13/PhoneNumber.java"
click node_immutable "https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter4/item17"
click node_api "https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter4/item25"
click node_generics "https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter5"
click node_annotations "https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter6/item39"
click node_enum "https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter6/item34"
click node_lambdas "https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter7"
click node_apiusage "https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter8"
click node_observable "https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter11/item79/ObservableSet.java"
click node_observers "https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter11/item79/SetObserver.java"
click node_forwarding "https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter11/item79/ForwardingSet.java"
click node_initialization "https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter11/item83/Initialization.java"
click node_fieldtype "https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter11/item83/FieldType.java"
click node_serialization "https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter12/Util.java"
click node_bomb "https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter12/item85/DeserializationBomb.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_builders,node_resource,node_equality,node_phoneclone,node_immutable,node_api toneBlue
class node_generics,node_annotations toneAmber
class node_enum,node_lambdas,node_apiusage toneMint
class node_observable,node_observers,node_forwarding,node_initialization,node_fieldtype toneRose
class node_serialization,node_bomb toneIndigo
```

## Components

### Objects and APIs

- [Object builders](https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter2/item2): `src/effectivejava/chapter2/item2`
- [Resource handling](https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter2/item9): `src/effectivejava/chapter2/item9`
- [Equality and ordering](https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter3/item10): `src/effectivejava/chapter3/item10`
- [Phone cloning](https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter3/item13/PhoneNumber.java): `src/effectivejava/chapter3/item13/PhoneNumber.java`
- [Immutable values](https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter4/item17): `src/effectivejava/chapter4/item17`
- [API design examples](https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter4/item25): `src/effectivejava/chapter4/item25`

### Types and Generics

- [Generic types](https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter5): `src/effectivejava/chapter5`
- [Annotations and tests](https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter6/item39): `src/effectivejava/chapter6/item39`

### Enums and Functional

- [Enum patterns](https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter6/item34): `src/effectivejava/chapter6/item34`
- [Lambdas and streams](https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter7): `src/effectivejava/chapter7`
- [API usage examples](https://github.com/jbloch/effective-java-3e-source-code/tree/master/src/effectivejava/chapter8): `src/effectivejava/chapter8`

### Concurrency

- [Observable set](https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter11/item79/ObservableSet.java): `src/effectivejava/chapter11/item79/ObservableSet.java`
- [Set observer](https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter11/item79/SetObserver.java): `src/effectivejava/chapter11/item79/SetObserver.java`
- [Forwarding set](https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter11/item79/ForwardingSet.java): `src/effectivejava/chapter11/item79/ForwardingSet.java`
- [Lazy initialization](https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter11/item83/Initialization.java): `src/effectivejava/chapter11/item83/Initialization.java`
- [Field value type](https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter11/item83/FieldType.java): `src/effectivejava/chapter11/item83/FieldType.java`

### Serialization

- [Serialization utilities](https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter12/Util.java): `src/effectivejava/chapter12/Util.java`
- [Deserialization example](https://github.com/jbloch/effective-java-3e-source-code/blob/master/src/effectivejava/chapter12/item85/DeserializationBomb.java): `src/effectivejava/chapter12/item85/DeserializationBomb.java`

## Connections

- Observable set → Forwarding set: extends (evidence: `src/effectivejava/chapter11/item79/ObservableSet.java`)
- Observable set → Set observer: notifies (evidence: `src/effectivejava/chapter11/item79/ObservableSet.java`)
- Lazy initialization → Field value type: creates (evidence: `src/effectivejava/chapter11/item83/Initialization.java`)
- Deserialization example → Serialization utilities: serializes and deserializes (evidence: `src/effectivejava/chapter12/item85/DeserializationBomb.java`)
- API usage examples → API design examples: references (evidence: `src/effectivejava/chapter4/item25/Main.java`)
