MetaCart Sign in to MyCiteSeerX

Include Citations | Advanced Search | Help

Disambiguated Search | Include Citations | Advanced Search | Help

Variations on the Visitor Pattern (1996) [1 citations — 0 self]

by Martin E. Nordberg ,  III
Add To MetaCart

Abstract:

Two variations on the Visitor pattern are presented. A Default Visitor provides default handlers for cases where the polymorphism of the hierarchy of elements can reduce the cost of code maintenance. An Extrinsic 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. The extrinsic visitor pattern provides several benefits in ease of software development in trade for poorer run time performance. Interesting design tradeoffs between efficiency and maintainability determine the choice of the standard, default, or extrinsic visitor pattern in an application. Introduction The Visitor pattern is an increasingly widely used design pattern for the traversal of relatively fixed class hierarchies described in the book Design Patterns[1]. The presentation in this article relies on the reader's familiarity with the pattern as presented in t...

Citations

3853 Design Patterns: Elements of Reusable Object-Oriented Software – Gamma, Helm, et al. - 1995
1 Code Reuse, Concrete Classes and Inheritance – Meyers