diff --git a/acyclic-visitor/README.md b/acyclic-visitor/README.md index 33c894ce7..939fe38b9 100644 --- a/acyclic-visitor/README.md +++ b/acyclic-visitor/README.md @@ -22,6 +22,16 @@ This pattern can be used: * When the visited class hierarchy will be frequently extended with new derivatives of the Element class. * When the recompilation, relinking, retesting or redistribution of the derivatives of Element is very expensive. +## Consequences +The good: +* No dependency cycles between class hierarchies. +* No need to recompile all the visitors if a new one is added. +* Does not cause compilation failure in existing visitors if class hierarchy has a new member. + +The bad: +* Violates the principle of least surprise or Liskov's Substitution principle by showing that it can accept all visitors but actually only being interested in particular visitors. +* Parallel hierarchy of visitors has to be created for all members in visitable class hierarchy. + ## Related patterns * [Visitor Pattern](../visitor/README.md)