<<< Visitor | Index | Visitor Structure >>> |
One possible solution is to
derive all objects from a common base class
add required operations to existing classes.
However, many distinct and unrelated operations will be performed on the nodes of the three-dimensional scene structure...
...and sometimes it is best to avoid "polluting" existing classes with new operations.
Better solution: use Visitor design pattern, which allows to
traverse objects inside complex structures
keep related operations together by defining them inside the Visitor class.
<<< Visitor | Index | Visitor Structure >>> |