Mediator: sync post code blocks to repo exactly, Java 25, add H6 file labels, full console output, README mapping

This commit is contained in:
2026-06-24 16:45:37 +05:30
parent 7b156a7c50
commit 78a99c4f96
2 changed files with 48 additions and 0 deletions

View File

@@ -355,6 +355,23 @@ javac 03-behavioral/iterator/*.java -d out/iterator
java -cp out/iterator iterator.Main
```
### Mediator (`03-behavioral/mediator/`)
| Post Section | File(s) |
|---|---|
| Implementation: Chat Room — the Mediator interface | `ChatMediator.java` |
| Implementation: Chat Room — the Colleague | `User.java` |
| Implementation: Chat Room — the Concrete Mediator | `ChatRoom.java` |
| Implementation: Chat Room — wiring it together | `Main.java` |
Note: the "Mediator in Practice: MVC and Spring Events" snippet (`ApplicationEventPublisher`/`@EventListener` example) is illustrative only — it is not part of this repository's runnable example.
Run it:
```bash
javac 03-behavioral/mediator/*.java -d out/mediator
java -cp out/mediator mediator.Main
```
## Reference
- *Design Patterns: Elements of Reusable Object-Oriented Software* — Gamma, Helm, Johnson, Vlissides