TITLE: VARIATIONS ON THE VISITOR PATTERN AUTHOR: Martin E. Nordberg III E-MAIL: 102571.1562@compuserve.com ADDRESS: Quintessoft Engineering, Inc. 3135 S. State Street, Suite 108 Ann Arbor, MI 48108 PH: 313-669-0192 FAX: 313-669-0193 e-mail: info@quintessoft.com WEB: www.quintessoft.com ABSTRACT: A short catalog of variations on the Visitor pattern is presented. A Polymorphic Visitor provides default handlers for cases where the polymorphism of the hierarchy of elements can reduce the cost of code maintenance. A Dynamic Visitor implements double dispatch with run time type information instead of Accept( ) methods. With the same machinery it is possible to test the feasibility of a particular visit before performing its operation. Design tradeoffs determine the choice of the standard, polymorphic, or dynamic visitor pattern in an application. A Multiple Visitor extends double dispatch to multiple dispatch, generally in response to different design forces. A Traversal Visitor introduces a two-layered structure of visitors to handle object structure traversals that depend upon starting point. OUTLINE: Introduction Polymorphic Visitor Dynamic Visitor Choosing a Visitor Pattern Variation Multiple Visitor Traversal Visitor Concluding Thoughts