By bloid
via groovy.codehaus.org
Published: Mar 27 2007 / 14:33
The visitor pattern is of these known, but not often used patterns. I think this is strange, as it is really a nice thing.
What is it used for? Basically it used to iterate over a tree structure where each node might be of a different type and an iterator has to react to these types different.
Comments
Ricky Clarkson replied ago:
This post is made too complicated for the concept it's demonstrating, simply by assuming that Visitor is only for trees. It doesn't necessarily need to involve collections of any type at all.
Voters For This Link (12)
Voters Against This Link (0)