Proxy: sync post code blocks to repo exactly, Java 25, add H6 file labels and README mapping

This commit is contained in:
2026-06-24 15:49:56 +05:30
parent 8f56ac2854
commit 04c8c0389f
2 changed files with 50 additions and 0 deletions

View File

@@ -287,6 +287,24 @@ javac 02-structural/flyweight/*.java -d out/flyweight
java -cp out/flyweight flyweight.Main
```
### Proxy (`02-structural/proxy/`)
| Post Section | File(s) |
|---|---|
| The Subject Interface | `DatabaseConnection.java` |
| The Real Subject | `RealDatabaseConnection.java` |
| Virtual Proxy: Lazy Initialisation | `LazyConnectionProxy.java` |
| Logging Proxy: Cross-Cutting Concerns | `LoggingProxy.java` |
| Wiring It Together: Proxy Chaining | `Main.java` |
Note: the "Dynamic Proxy with java.lang.reflect.Proxy" snippet is illustrative only — it is not part of this repository's runnable example.
Run it:
```bash
javac 02-structural/proxy/*.java -d out/proxy
java -cp out/proxy proxy.Main
```
## Reference
- *Design Patterns: Elements of Reusable Object-Oriented Software* — Gamma, Helm, Johnson, Vlissides