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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Benbasat, I., Goldstein, D.K., Mead, M.: The case research strategy in studies of information systems. MIS Q. 11, 369–386 (1987)
Chatzigeorgiou, A., Tsantalis, N., Deligiannis, I.S.: An empirical study on students’ ability to comprehend design patterns. Computers & Education 51(3), 1007–1016 (2008)
Coleman, D., Ash, D., Lowther, B., Oman, P.: Using metrics to evaluate software system maintainability. Computer 27, 44–49 (1994)
Cook, W.R.: On understanding data abstraction, revisited. In: Proceedings of OOPSLA 2009, pp. 557–572. ACM Press, New York (2009)
Eden, A., Mens, T.: Measuring Software Flexibility. IEE Proceedings—Software 153(3), 113–125 (2006)
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)
Gamma, E., Helm, R., Johnson, R.E., Vlissides, J.: Design Patterns. Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1995)
Hannemann, J., Kiczales, G.: Design pattern implementation in Java and AspectJ. In: Proceedings of OOPSLA 2002, pp. 161–173. ACM Press, New York (2002)
Heitlager, I., Kuipers, T., Visser, J.: A practical model for measuring maintainability. In: Proceedings of QUATIC 2007, pp. 30–39. IEEE, Los Alamitos (2007)
Henderson-Sellers, B.: Object-oriented metrics: measures of complexity. Prentice-Hall, Englewood Cliffs (1996)
Hills, M.: Rascal Visitor to Interpreter (V2I) Transformation, http://www.cwi.nl/~hills/rascal/V2I.html
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)
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)
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)
Mens, T., Eden, A.H.: On the Evolution Complexity of Design Patterns. In: Proceedings of SETra 2004. ENTCS, vol. 127, pp. 147–163 (2004)
Oman, P., Hagemeister, J.: Construction and testing of polynomials predicting software maintainability. J. Syst. Softw. 24, 251–266 (1994)
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)
Wadler, P.: The expression problem (November 1998), http://www.daimi.au.dk/~madst/tool/papers/expression.txt (accessed January 2011)
Wender, K.F., Schmalhofer, F., Böcker, H.-D. (eds.): Cognition and computer programming. Ablex Publishing Corp. (1995)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)