Abstract
Wrappers are mechanisms for introducing new behavior that is executed before and/or after, and perhaps even in lieu of, an existing method. This paper examines several ways to implement wrappers in Smalltalk, and compares their performance. Smalltalk programmers often use Smalltalk's lookup failure mechanism to customize method lookup. Our focus is different. Rather than changing the method lookup process, we modify the method objects that the lookup process returns. We call these objects method wrappers. We have used method wrappers to construct several program analysis tools: a coverage tool, a class collaboration tool, and an interaction diagramming tool. We also show how we used method wrappers to construct several extensions to Smalltalk: synchronized methods, assertions, and multimethods. Wrappers are relatively easy to build in Smalltalk because it was designed with reflective facilities that allow programmers to intervene in the lookup process. Other languages differ in the degree to which they can accommodate change. Our experience testifies to the value, power, and utility of openness.
Preview
Unable to display preview. Download preview PDF.
References
Kent Beck. Using demand loading. The Smalltalk Report, 4(4): 19–23, January 1995.
John K. Bennett. The design and implementation of distributed Smalltalk. In Proceedings OOPSLA '87, pages 318–330, December 1987. Published as ACM SIGPLAN Notices, volume 22, number 12.
Heinz-Dieter Böcker and Jürgen Herczeg, What Tracers are Made Of, ECOOP/OOPSLA '90 Conference Proceedings, SIGPLAN Notices, Volume 25, Number 10, October 1990
Dan G. Bobrow, Linda G. DeMichiel, Richard P. Gabriel, Sonya E. Keene, Gregor Kiczales, and David A. Moon. Common lisp object system specification. SIGPLAN Notices, 23, September 1988.
Daniel G. Bobrow and Mark Stefik. The LOOPS Manual. Xerox PARC, 1983.
Kraig Brockschmidt. Inside OLE, second edition, Microsoft Press, Redmond, Washington, 1995.
Manuela Carrillo-Castellon, Jesus Garcia-Molina, and Ernesto Pimentel. Eiffel-like assertions and private methods in Smalltalk. In TOOLS 13, pages 467–478, 1994.
Pierre Cointe, The Classtalk System: a Laboratory to Study Reflection in Smalltalk, OOPSLA/ECOOP '90 Workshop on Reflection and Metalevel Architectures in Object-Oriented Programming, Mamdouh Ibrahim, organizer.
Margaret A. Ellis and Bjarne Stroustrup. The Annotated C++ Reference Manual. Addison-Wesley, Reading, Massachusetts, 1990.
Brian Foote and Ralph E. Johnson. Reflective facilities in Smalltalk-80. In Proceedings OOPSLA '89, pages 327–336, October 1989. Published as ACM SIGPLAN Notices, volume 24, number 10.
Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley, 1995.
B. Garbinato, R. Guerraoui, and K. Mazoui. Implementation of the GARF Replicated Objects Platform. In Distributed Systems Engineering Journal, (2), 1995, 14–27.
James Gosling, Bill Joy, and Guy Steele, The Java ℳ Language Specification, Addison-Wesley, 1996.
R. Guerraoui, B. Garbinato, and K. Mazouni. The GARF System. In IEEE Concurrency, 5(4), 1997.
Bob Hinkle and Ralph E. Johnson. Taking exception to Smalltalk. The Smalltalk Report, 2(3), November 1992.
Bob Hinkle, Vicki Jones, and Ralph E. Johnson. Debugging objects. The Smalltalk Report, 2(9), July 1993.
Daniel H. H. Ingalls, The Evolution of the Smalltalk-80 Virtual Machine, in Smalltalk-80, Bits of History, Words of Advice, Glenn Krasner, editor, Addision-Wesley, Reading, MA, 1983
Gregor Kiczales, Jim des Rivieres, and Daniel G. Bobrow, The Art of the Metaobject Protocol, MIT Press, 1991.
Gregor Kiczales and John Lamping, Issues in the Design and Implementation of Class Libraries, OOPSLA '92, Vancouver, BC, SIGPLAN Notices Volume 27, Number 10, October 1992.
Bent Bruun Kristensen, Ole Lehrmann Madsen, Birger Moller-Pedersen, and Kristen Nygaard, Object-Oriented Programming in the Beta Language, 8 October, 1990.
Wilf R. LaLonde and Mark Van Gulik. Building a backtracking facility in Smalltalk without kernel support. In Proceedings OOPSLA '88, pages 105–122, November 1988. Published as ACM SIGPLAN Notices, volume 23, number 11.
Danny B. Lange and Yuichi Nakamura, Interactive Visualization of Design Patterns Can Help in Framework Understanding, In Proceedings of OOPSLA '95, pages 342–357, October 1995, Published as ACM SIGPLAN Notices, volume 30, number 10
Paul L. McCullough. Transparent forwarding: First steps. In Proceedings OOPSLA '87, pages 331–341, December 1987. Published as ACM SIGNPLAN Notices, volume 22, number 12.
Steven L. Messick and Kent L. Beck. Active variables in Smalltalk-80. Technical Report CR-85-09, Computer Research Lab, Tektronix, Inc., 1985.
Bertrand Meyer. Eiffel: The Language. Prentice-Hall, 1992.
Geoffrey A. Pascoe. Encapsulators: A new software paradigm in Smalltalk-80. In Proceedings OOPSLA '86, pages 341–346, November 1986. Published as ACM SIGPLAN Notices, volume 21, number 11.
Fred Rivard. Smalltalk: a reflective language. In Proceedings Reflection '96.
Bjarne Stroustrop. The Design and Evolution of C++. Addison-Wesley, Reading, MA 1994.
Michael D. Tiemann. Solving the RPC problem in GNU C++. In 1988 USENIX C++ Conference, pages 17–21, 1988.
D. Weinreb, and D. Moon. Lisp Machine Manual, Symbolics, 1981.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1998 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Brant, J., Foote, B., Johnson, R.E., Roberts, D. (1998). Wrappers to the rescue. In: Jul, E. (eds) ECOOP’98 — Object-Oriented Programming. ECOOP 1998. Lecture Notes in Computer Science, vol 1445. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0054101
Download citation
DOI: https://doi.org/10.1007/BFb0054101
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-64737-9
Online ISBN: 978-3-540-69064-1
eBook Packages: Springer Book Archive