Skip to main content

A Case of Visitor versus Interpreter Pattern

  • Conference paper
Objects, Models, Components, Patterns (TOOLS 2011)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6705))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Benbasat, I., Goldstein, D.K., Mead, M.: The case research strategy in studies of information systems. MIS Q. 11, 369–386 (1987)

    Article  Google Scholar 

  2. Chatzigeorgiou, A., Tsantalis, N., Deligiannis, I.S.: An empirical study on students’ ability to comprehend design patterns. Computers & Education 51(3), 1007–1016 (2008)

    Article  Google Scholar 

  3. Coleman, D., Ash, D., Lowther, B., Oman, P.: Using metrics to evaluate software system maintainability. Computer 27, 44–49 (1994)

    Article  Google Scholar 

  4. Cook, W.R.: On understanding data abstraction, revisited. In: Proceedings of OOPSLA 2009, pp. 557–572. ACM Press, New York (2009)

    Google Scholar 

  5. Eden, A., Mens, T.: Measuring Software Flexibility. IEE Proceedings—Software 153(3), 113–125 (2006)

    Google Scholar 

  6. Fleming, S.D., Kraemer, E., Stirewalt, R.E.K., Dillon, L.K., Xie, S.: Refining Existing Theories of Program Comprehension During Maintenance for Concurrent Software. In: Proceedings of ICPC 2008, pp. 23–32. IEEE, Los Alamitos (2008)

    Google Scholar 

  7. Gamma, E., Helm, R., Johnson, R.E., Vlissides, J.: Design Patterns. Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1995)

    MATH  Google Scholar 

  8. Hannemann, J., Kiczales, G.: Design pattern implementation in Java and AspectJ. In: Proceedings of OOPSLA 2002, pp. 161–173. ACM Press, New York (2002)

    Google Scholar 

  9. Heitlager, I., Kuipers, T., Visser, J.: A practical model for measuring maintainability. In: Proceedings of QUATIC 2007, pp. 30–39. IEEE, Los Alamitos (2007)

    Google Scholar 

  10. Henderson-Sellers, B.: Object-oriented metrics: measures of complexity. Prentice-Hall, Englewood Cliffs (1996)

    Google Scholar 

  11. Hills, M.: Rascal Visitor to Interpreter (V2I) Transformation, http://www.cwi.nl/~hills/rascal/V2I.html

  12. International Standard, I.: - ISO/IEC 14764 IEEE Std 14764-2006. ISO/IEC 14764:2006 (E) IEEE Std 14764-2006 Revision of IEEE Std 1219-1998), pp. 1–46 (2006)

    Google Scholar 

  13. Klint, P., van der Storm, T., Vinju, J.: EASY meta-programming with rascal. In: Fernandes, J.M., Lämmel, R., Visser, J., Saraiva, J. (eds.) Generative and Transformational Techniques in Software Engineering III. LNCS, vol. 6491, pp. 222–289. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  14. Littman, D.C., Pinto, J., Letovsky, S., Soloway, E.: Mental models and software maintenance. In: Proceedings of the First Workshop on Empirical Studies of Programmers, pp. 80–98. Ablex Publishing Corp. (1986)

    Google Scholar 

  15. Mens, T., Eden, A.H.: On the Evolution Complexity of Design Patterns. In: Proceedings of SETra 2004. ENTCS, vol. 127, pp. 147–163 (2004)

    Google Scholar 

  16. Oman, P., Hagemeister, J.: Construction and testing of polynomials predicting software maintainability. J. Syst. Softw. 24, 251–266 (1994)

    Article  Google Scholar 

  17. Prechelt, L., Unger, B., Tichy, W.F., Brössler, P., Votta, L.G.: A Controlled Experiment in Maintenance Comparing Design Patterns to Simpler Solutions. IEEE Transactions on Software Engineering 27(12), 1134–1144 (2001)

    Article  Google Scholar 

  18. Wadler, P.: The expression problem (November 1998), http://www.daimi.au.dk/~madst/tool/papers/expression.txt (accessed January 2011)

  19. Wender, K.F., Schmalhofer, F., Böcker, H.-D. (eds.): Cognition and computer programming. Ablex Publishing Corp. (1995)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Hills, M., Klint, P., van der Storm, T., Vinju, J. (2011). A Case of Visitor versus Interpreter Pattern. In: Bishop, J., Vallecillo, A. (eds) Objects, Models, Components, Patterns. TOOLS 2011. Lecture Notes in Computer Science, vol 6705. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-21952-8_17

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-21952-8_17

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-21951-1

  • Online ISBN: 978-3-642-21952-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics