Sync Composite to Java 25: H6 file labels, fix console output typo, README mapping
This commit is contained in:
16
README.md
16
README.md
@@ -215,6 +215,22 @@ javac 02-structural/bridge/*.java -d out/bridge
|
||||
java -cp out/bridge bridge.Main
|
||||
```
|
||||
|
||||
### Composite (`02-structural/composite/`)
|
||||
|
||||
| Post Section | File(s) |
|
||||
|---|---|
|
||||
| The Problem: Treating Leaves and Containers Uniformly | illustrative only — not part of this repository's runnable example |
|
||||
| Step 1 — The Component Interface | `FileSystemItem.java` |
|
||||
| Step 2 — The Leaf (File) | `File.java` |
|
||||
| Step 3 — The Composite (Directory) | `Directory.java` |
|
||||
| Building and Using the Tree | `Main.java` |
|
||||
|
||||
Run it:
|
||||
```bash
|
||||
javac 02-structural/composite/*.java -d out/composite
|
||||
java -cp out/composite composite.Main
|
||||
```
|
||||
|
||||
## Reference
|
||||
|
||||
- *Design Patterns: Elements of Reusable Object-Oriented Software* — Gamma, Helm, Johnson, Vlissides
|
||||
|
||||
Reference in New Issue
Block a user