User Tools

Site Tools


patterns:dp_visitor

Table of Contents

Visitor

Goals

Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.

This pattern usually makes use of a double dispatch mechanism to:

  • avoid the visitor to have knowledge about the element structure for visiting it
  • avoid the element to have knowledge about the operation the visitor performs

UML

C#

 

patterns/dp_visitor.txt · Last modified: 2015/07/26 14:52 by jaap.dehaan