A case of visitor versus interpreter pattern

  • Authors:
  • Mark Hills;Paul Klint;Tijs Van Der Storm;Jurgen Vinju

  • Affiliations:
  • Centrum Wiskunde & Informatica, Amsterdam, The Netherlands and INRIA Lille Nord Europe, France;Centrum Wiskunde & Informatica, Amsterdam, The Netherlands and INRIA Lille Nord Europe, France;Centrum Wiskunde & Informatica, Amsterdam, The Netherlands;Centrum Wiskunde & Informatica, Amsterdam, The Netherlands and INRIA Lille Nord Europe, France

  • Venue:
  • TOOLS'11 Proceedings of the 49th international conference on Objects, models, components, patterns
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

We compare the Visitor pattern with the Interpreter pattern, investigating a single case in point for the Java language. We have produced and compared two versions of an interpreter for a programming language. The first version makes use of the Visitor pattern. The second version was obtained by using an automated refactoring to transform uses of the Visitor pattern to uses of the Interpreter pattern. We compare these two nearly equivalent versions on their maintenance characteristics and execution efficiency. Using a tailored experimental research method we can highlight differences and the causes thereof. The contributions of this paper are that it isolates the choice between Visitor and Interpreter in a realistic software project and makes the difference experimentally observable.