Flyweight: sync post code blocks to repo exactly, Java 25, add H6 file labels and README mapping
This commit is contained in:
17
README.md
17
README.md
@@ -270,6 +270,23 @@ javac 02-structural/facade/*.java -d out/facade
|
||||
java -cp out/facade facade.Main
|
||||
```
|
||||
|
||||
### Flyweight (`02-structural/flyweight/`)
|
||||
|
||||
| Post Section | File(s) |
|
||||
|---|---|
|
||||
| Step 1 — The Flyweight (TreeType) | `TreeType.java` |
|
||||
| Step 2 — The Factory (TreeFactory) | `TreeFactory.java` |
|
||||
| Step 3 — The Context (Tree) | `Tree.java` |
|
||||
| Putting the Forest Together | `Main.java` |
|
||||
|
||||
Note: the "Flyweight in the JDK: String Pool and Integer Cache" and "Measuring the Benefit" snippets are illustrative only — they are not part of this repository's runnable example.
|
||||
|
||||
Run it:
|
||||
```bash
|
||||
javac 02-structural/flyweight/*.java -d out/flyweight
|
||||
java -cp out/flyweight flyweight.Main
|
||||
```
|
||||
|
||||
## Reference
|
||||
|
||||
- *Design Patterns: Elements of Reusable Object-Oriented Software* — Gamma, Helm, Johnson, Vlissides
|
||||
|
||||
Reference in New Issue
Block a user