Open main menu

CDOT Wiki β

Changes

Visitor

411 bytes added, 21:14, 8 April 2007
UML Diagram
== UML Diagram ==
[[Image:Visitor.jpg]]
 
The key is the Accept method in the ConcreteElement classes. The body of this method shows the double dispatching call, where the Visitor is passed in to the accept method, and that visitor is told to execute its visit method, and is handed the node by the node itself. This makes for very robust code, since all of the decision making as to what to execute where and when it taken care of by the dispatching.
1
edit