Sync Bridge to Java 25: H6 file labels, README mapping

This commit is contained in:
2026-06-24 14:27:07 +05:30
parent 8471913dbd
commit 4091345b20
8 changed files with 58 additions and 89 deletions

View File

@@ -10,21 +10,23 @@ Decouples remote controls (Abstraction) from devices (Implementation). A basic r
## How to run
```bash
javac bridge/*.java
java bridge.Main
javac bridge/*.java -d out/bridge
java -cp out/bridge bridge.Main
```
Requires Java 11+.
Requires Java 25.
## Files
## Post Section ↔ File Mapping
| File | Role |
| Post Section | File(s) |
|---|---|
| `Device.java` | Implementor interface |
| `TV.java` / `Radio.java` | Concrete Implementors |
| `RemoteControl.java` | Abstraction (holds Device bridge) |
| `AdvancedRemote.java` | Refined Abstraction |
| `Main.java` | Demo entry point |
| Step 1 — The Implementor Interface | `Device.java` |
| Step 2 — Concrete Implementors (TV and Radio) | `TV.java`, `Radio.java` |
| Step 3 — The Abstraction (RemoteControl) | `RemoteControl.java` |
| Step 4 — Refined Abstraction (AdvancedRemote) | `AdvancedRemote.java` |
| Wiring It Together: Main Demo | `Main.java` |
Note: the "Class Explosion Problem — Visualised" pseudocode and the JDBC/SLF4J snippets shown in the article are illustrative only — they are not part of this repository's runnable example.
Article: https://ankurm.com/bridge-design-pattern-java/
All patterns: https://ankurm.com/design-patterns-java/