Previous article

Next article


Featherweight Wrap Java: wrapping objects and methods

Lorenzo Bettini, bettini@dsi.unifi.it Dipartimento di Informatica, Università di Torino
Sara Capecchi, capecchi@dmi.unict.it Dipartimento di Matematica e Informatica, Università di Catania
Elena Giachino, giachino@di.unito.it Dipartimento di Informatica, Università di Torino

space REFEREED
ARTICLE


PDF Icon
PDF Version

Abstract

This work has been partially supported by the MIUR project EOS-DUE. We present a language extension, which integrates in a Java like language a mechanism for dynamically extending object behaviors without changing their type. Our approach consists in moving the addition of new features from class (static) level to object (dynamic) level: the basic features of entities (representing their structure) are separated from the additional ones (wrapper classes whose instances represent run-time added behaviors). At run-time, these entities can be dynamically composed by instantiating wrapper objects which are attached to basic entities. Wrappers permit specializing (wrapping) methods at run-time: the method of the wrapper will be automatically executed after the method of the wrapped objects, using a delegation mechanism. Furthermore, wrapped methods can return values and values returned by the wrapped methods are transparently made available in the wrapper methods. We formalize our extension by adding the new constructs to Featherweight Java and we prove that the core language so extended (Featherweight Wrap Java) is type safe.


Note: Due to the typographical sophistication of this article, no HTML version is available. Please use the PDF version.

About the authors



 

Lorenzo Bettini is a Researcher in Computer Science at Dipartimento di Informatica, University of Torino, Italy. His research focuses on theory, extension and implementation of mobile code and object-oriented languages, and on distributed applications. He can be reached at bettini@dsi.unifi.it or http://www.lorenzobettini.it



  Sara Capecchi is a research fellow in Computer Science at Dipartimento di Matematica e Informatica, Università di Catania, Italy. Her research interests are types, calculi and extensions for object-oriented languages. She can be reached at capecchi@dmi.unict.it.

 

Elena Giachino is a PhD student in Computer Science at Dipartimento di Informatica, Università di Torino, Italy, and at Laboratoire PPS, Université Paris VII, France. Her research interests are types and calculi for object-oriented languages and concurrent processes. She can be reached at giachino@di.unito.it.


Cite this article as follows: Lorenzo Bettini, Sara Capecchi, Elena Giachino: "Featherweight Wrap Java: wrapping objects and methods", in Journal of Object Technology, vol. 7, no. 2, Special Issue OOPS Track at SAC 2007, February 2008, pp. 5-29, http://www.jot.fm/issues/issue_2008_02/article1/


Previous article

Next article