Abstract
We present a variation of the visitor pattern which allows programmers to write visitor-like code in a concise way. The Runabout is a library extension that adds a limited form of multi-dispatch to Java. While the Runabout is not as expressive as a general multiple dispatching facility, the Runabout can be significantly faster than existing implementations of multiple dispatch for Java, such as MultiJava. Unlike MultiJava, the Runabout does not require changes to the syntax and the compiler.
In this paper we illustrate how to use the Runabout, detail its implementation and provide benchmarks comparing its performance with other approaches.
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
Alpern, B., Cocchi, A., Fink, S.J., Grove, D., Lieber, D.: Efficient Implementation of Java Interfaces: Invokeinterface Considered Harmless. In: OOPSLA 2001 Conference on Object-Oriented Programming, Systems, Languages, and Applications, Tampa, Florida, pp. 108–124 (2001)
Bracha, G., Odersky, M., Stoutamire, D., Wadler, P.: Making the future safe for the past: Adding genericity to the Java programming language. In: OOPSLA Proceedings. ACM Press, Vancouver (1998)
Bravenboer, M., Visser, E.: Guiding visitors: Separating navigation from computation. Technical report, Institute of Information and Computing Sciences, Utrecht University (2001)
Breuel, T.M.: Implementing dynamic language features in java using dynamic code generation. In: Proceedings 39th International Conference and Exhibition on Technology of Object-Oriented Languages and Systems. TOOLS 39, pp. 143–52 (2001)
Chambers, C.: Object-oriented multi-methods in Cecil. In: Lehrmann Madsen, O. (ed.) ECOOP 1992. LNCS, vol. 615, pp. 33–56. Springer, Heidelberg (1992)
Chambers, C., Chen, W.: Efficient multiple and predicate dispatching. In: Proceedings of the 1999 ACM Conference on Object-Oriented Programming Languages, Systems, and Applications (OOPSLA 1999), ACM SIGPLAN Notices, Denver, CO, vol. 34(10), pp. 238–255. ACM, New York (1999)
Clifton, C., Leavens, G.T., Chambers, C., Millstein, T.: MultiJava: Modular open classes and symmetric multiple dispatch for Java. In: OOPSLA 2000 Conference on Object-Oriented Programming, Systems, Languages, and Applications, Minneapolis, Minnesota, vol. 35(10), pp. 130–145 (2000)
Dietzfelbinger, M., Karlin, A.R., Mehlhorn, K., auf der Heide, F.M., Rohnert, H., Tarjan, R.E.: Dynamic perfect hashing: Upper and lower bounds. In: IEEE Symposium on Foundations of Computer Science, pp. 524–531 (1988)
Driesen, K., Hölzle, U., Vitek, J.: Message dispatch on pipelined processors. In: Olthoff, W. (ed.) ECOOP 1995. LNCS, vol. 952, pp. 253–283. Springer, Heidelberg (1995)
Dutchyn, C.: Multi-dispatch in the Java Virtual Machine: Design and implementation. Master’s thesis, Department of Computing Science, University of Alberta, Edmonton, Alberta, Canada (2001)
Flatt, M.: Programming Languages for Reusable Software Components. Technical Report TR99-345, 20 (1999)
Flatt, M., Felleisen, M.: Units: Cool modules for HOTlan guages. In: Proceedings of the ACM SIGPLAN 1998 Conference on Programming Language Design and Implementation, pp. 236–248 (1998)
Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and Mixins. In: Conference Record of POPL 1998: The 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Diego, California, New York, NY, pp. 171–183 (1998)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison Wesley, Massachusetts (1994)
Gosling, J., Joy, B., Steele, G.: The Java Language Specification. Addison-Wesley, Reading (1996)
Grothoff, C., Palsberg, J., Vitek, J.: Encapsulating Objects with Confined Types. In: OOPSLA 2001 Conference on Object-Oriented Programming, Systems, Languages, and Applications, Tampa, Florida, pp. 241–253 (2001)
Nordberg III, M.E.: Variations of the Visitor Pattern (1996)
Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An Overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 327–355. Springer, Heidelberg (2001)
Krishnamurthi, S., Felleisen, M., Friedman, D.P.: Synthesizing Object-Oriented and Functional Design to Promote Re-use. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 91–113. Springer, Heidelberg (1998)
Naik, M., Kumar, R.: Efficient message dispatch in object-oriented systems. ACM SIGPLAN Notices 35(3), 49–58 (2000)
Nystrom, N., Clarkson, M.R., Myers, A.C.: Polyglot: An Extensible Compiler Framework for Java. In: Hedin, G. (ed.) CC 2003. LNCS, vol. 2622, pp. 138–152. Springer, Heidelberg (2003)
Odersky, M., Wadler, P.: Pizza into Java: Translating Theory into Practice. In: Proceedings of the 24th ACM Symposium on Principles of Programming Languages (POPL 1997), Paris, France, pp. 146–159. ACM Press, New York (1997)
Ovlinger, J., Wand, M.: A Language for Specifying Traversals of Object Structures. Technical report, College of Computer Science, Northeastern University, Boston, MA (November 1998)
OVM Consortium (2002), http://www.ovmj.org/
Palacz, K., Baker, J., Flack, C., Grothoff, C., Yamauchi, H., Vitek, J.: Engineering a Customizable Intermediate Representation. In: ACM SIGPLAN 2003 Workshop on Interpreters, Virtual Machines and Emulators (IVME 2003), ACM SIGPLAN (2003)
Palsberg, J., Barry Jay, C.: The Essence of the Visitor Pattern. In: Proc. 22nd IEEE Int. Computer Software and Applications Conf., COMPSAC, pp. 9–15 (1998)
Stroustrup, B.: Multiple Inheritance for C++. In: Proceedings of the Spring 1987 European Unix Users Group Conference, Helsinki (1987)
Zenger, M., Odersky, M.: Implementing Extensible Compilers. In: Workshop on Multiparadigm Programming with Object-Oriented Languages, Budapest, Hungary (June 2001)
Zibin, Y., Gil (Y.) J.: Fast Algorithm for Creating Space Efficient Dispatching Tables with Application to Multi-Dispatching. In: OOPSLA 2002 Conference on Object-Oriented Programming, Systems, Languages, and Applications, Seattle, Washington, pp. 142–160 (2002)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Grothoff, C. (2003). Walkabout Revisited: The Runabout. In: Cardelli, L. (eds) ECOOP 2003 – Object-Oriented Programming. ECOOP 2003. Lecture Notes in Computer Science, vol 2743. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-45070-2_6
Download citation
DOI: https://doi.org/10.1007/978-3-540-45070-2_6
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-40531-3
Online ISBN: 978-3-540-45070-2
eBook Packages: Springer Book Archive