visitor 100 class the element 110 class or client classes that use them to effect double dispatch fig5 a and 5b illustrate such groupings in a preferred embodiment appelement 200 is an abstract subclass of element 110 appelementa 205 appelementb 210 and appelementc 215 are concrete subclasses of appelement 200 these concrete subclasses are descendants of the element base class 110 there may be any number of such subclasses in addition to the accept 160 operation that appelement 200 inherits from element 110 appelement 200 introduces an accept 220 operation that takes an argument 230 of type appvisitor 240 which is an abstract subclass of visitor 100 appvisitor 240 implements the visit 130 operation it inherits from visitor 100 by attempting to downcast its argument 140 to the appelement 200 type this occurs in implementation 242 in a preferred embodiment this downcast succeeds if the argument is type compatible with appelement if so the implementation by appvisitor of visit 130 calls the appelement specific accept 220 on the newly downcast instance passing the receiving instance itself of type appvisitor 240 as an argument 242 in addition to the visit 130 operation that appvisitor 240 inherits from visitor 100 appvisitor 240 introduces specialized visit operations 245 255 preferably there is one specialized visit.