TITLE: VARIATIONS ON THE VISITOR PATTERN AUTHOR: Martin E. Nordberg III E-MAIL: 102571.1562@compuserve.com ADDRESS: Quintessoft Engineering, Inc. 2640 Towner Blvd. Ann Arbor, MI 48104 PHONE: 313-971-7917 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