Chapter14.Using Bytecode Transformation to Integrate New Features


Chapter 14. Using Bytecode Transformation to Integrate New Features

GEOFF COHEN

An aspect-oriented software development system typically contains some mechanism that integrates multiple concern-handling constructs at a single point in code. This functionality is necessary because many different dimensions or aspects of the overall design could influence behavior at that single point. This chapter describes the technique of bytecode transformation to accomplish such integration. Bytecode transformation adds concerns to existing code by modifying compiled Java classfiles, transforming the original code through a set of changes specified by a user-supplied program. While bytecode transformation is a common implementation technique for aspect-oriented programming in Java [11], its full functionality is rarely exposed to the end-programmer. The use of user-defined transformation and the targeting of compiled classes (rather than source code) provide improved expressiveness and flexibility for the aspect-oriented software design process.

As part of our research into bytecode transformation, we built a prototype transformation environment called JOIE [4]. Although in principle bytecode transformation could apply to other bytecode formats, such as P-Code [15], the Microsoft Common Language Runtime [9], or some implementations of Smalltalk [8], our implementation is in Java, and this discussion considers only Java classfiles as a target.

This chapter describes the ways in which bytecode transformation can be an effective mechanism for implementing aspect-oriented software development systems. It begins with a short description of how the concept of transformation relates to aspect-oriented programming and then presents an overview of the technique of bytecode transformation. It describes programming with bytecode transformation, discusses its use in the broader context of aspect-oriented software development, and relates some lessons learned from experience.



Aspect-Oriented Software Development
Aspect-Oriented Software Development with Use Cases
ISBN: 0321268881
EAN: 2147483647
Year: 2003
Pages: 307

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net