Is there a way to implement visitor design pattern without cyclic dependency? What I mean is that the visitor need an object to visit. and the visited object needs a visitor to accept. In the end both depend on each other.
Found it again! Check out the Acyclic Visitor:
Quote:
Allow new functions to be added to existing class hierarchies without affecting those hierarchies, and without creating the troublesome dependency cycles that are inherent to the GOF VISITOR Pattern.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With