Sync Decorator to Java 25: H6 file labels, fix Main.java JDK-output mismatch, README mapping
This commit is contained in:
18
README.md
18
README.md
@@ -231,6 +231,24 @@ javac 02-structural/composite/*.java -d out/composite
|
||||
java -cp out/composite composite.Main
|
||||
```
|
||||
|
||||
### Decorator (`02-structural/decorator/`)
|
||||
|
||||
| Post Section | File(s) |
|
||||
|---|---|
|
||||
| Step 1 — Component Interface | `TextProcessor.java` |
|
||||
| Step 2 — Concrete Component | `PlainTextProcessor.java` |
|
||||
| Step 3 — Base Decorator | `TextDecorator.java` |
|
||||
| Step 4 — Concrete Decorators | `UpperCaseDecorator.java`, `TrimDecorator.java`, `ProfanityFilterDecorator.java` |
|
||||
| Stacking the Decorators — Order Matters | `Main.java` |
|
||||
|
||||
Note: the JDK `InputStream`/`BufferedInputStream`/`GZIPInputStream` snippet is illustrative only — it is not part of this repository's runnable example.
|
||||
|
||||
Run it:
|
||||
```bash
|
||||
javac 02-structural/decorator/*.java -d out/decorator
|
||||
java -cp out/decorator decorator.Main
|
||||
```
|
||||
|
||||
## Reference
|
||||
|
||||
- *Design Patterns: Elements of Reusable Object-Oriented Software* — Gamma, Helm, Johnson, Vlissides
|
||||
|
||||
Reference in New Issue
Block a user