Visitor: sync post code blocks to repo exactly (post used a completely different design - return-value visitors vs repo's void/print-in-place visitors, different Triangle model), split merged Circle/Rectangle/Triangle and AreaCalculator/PerimeterCalculator blocks, Java 25, H6 file labels, fix stale console output, README mapping
This commit is contained in:
19
README.md
19
README.md
@@ -460,6 +460,25 @@ javac 03-behavioral/template-method/*.java -d out/template-method
|
||||
java -cp out/template-method template.Main
|
||||
```
|
||||
|
||||
### Visitor (`03-behavioral/visitor/`)
|
||||
|
||||
| Post Section | File(s) |
|
||||
|---|---|
|
||||
| Implementation: Shape Geometry Operations — the Visitor interface | `ShapeVisitor.java` |
|
||||
| Implementation: Shape Geometry Operations — the Element interface | `Shape.java` |
|
||||
| Implementation: Shape Geometry Operations — Circle | `Circle.java` |
|
||||
| Implementation: Shape Geometry Operations — Rectangle | `Rectangle.java` |
|
||||
| Implementation: Shape Geometry Operations — Triangle | `Triangle.java` |
|
||||
| Implementation: Shape Geometry Operations — AreaCalculator | `AreaCalculator.java` |
|
||||
| Implementation: Shape Geometry Operations — PerimeterCalculator | `PerimeterCalculator.java` |
|
||||
| Implementation: Shape Geometry Operations — wiring it together | `Main.java` |
|
||||
|
||||
Run it:
|
||||
```bash
|
||||
javac 03-behavioral/visitor/*.java -d out/visitor
|
||||
java -cp out/visitor visitor.Main
|
||||
```
|
||||
|
||||
## Reference
|
||||
|
||||
- *Design Patterns: Elements of Reusable Object-Oriented Software* — Gamma, Helm, Johnson, Vlissides
|
||||
|
||||
Reference in New Issue
Block a user