docs: update acyclic visitor documentation

This commit is contained in:
Ilkka Seppälä
2025-03-24 19:16:41 +02:00
parent 3dc27b25bb
commit 324dad549f
2 changed files with 5 additions and 4 deletions
+5 -4
View File
@@ -29,6 +29,11 @@ In plain words
> The Acyclic Visitor pattern allows new functions to be added to existing class hierarchies without affecting those hierarchies, and without creating the dependency cycles that are inherent to the GangOfFour VisitorPattern.
Sequence diagram
![Acyclic Visitor sequence diagram](./etc/acyclic-visitor-sequence-diagram.png "Acyclic Visitor sequence diagram")
## Programmatic Example of Acyclic Visitor in Java
In this Java example, we have a hierarchy of modem classes illustrating the Acyclic Visitor pattern. The modems in this hierarchy need to be visited by an external algorithm based on filtering criteria (is it Unix or DOS compatible modem).
@@ -138,10 +143,6 @@ Program output:
09:15:11.127 [main] INFO com.iluwatar.acyclicvisitor.ConfigureForUnixVisitor -- Zoom modem used with Unix configurator.
```
## Acyclic Visitor Pattern Class Diagram
![Acyclic Visitor](./etc/acyclic-visitor.png "Acyclic Visitor")
## When to Use the Acyclic Visitor Pattern in Java
This pattern can be used:
Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB