Visit All Children
Context
A design rule for implementing the
visit
methods of in a visitor design pattern.
The rule is probably application specific in that it needs to be tailored to a specific visitor implementation and may not be desirable to use with all visitor implementations (the restriction it imposes may be too strong).
Description
When implementing a visitor method for
SomeSpecificClass in
SomeSpecificClassHierarchy and
SomeSpecificVisitor, ensure that you always call the visit method for each field of the visitedNode that also contains a visitable element.
Rationale
Example
Definition
Ruminations
--
KrisDeVolder - 05 May 2005