Runtime aspect weaving through metaprogramming
Jason Baker, Wilson C. Hsieh · International Conference on Aspect-Oriented Software Development (AOSD) · 2002
We describe an extension to the Java language, Handi-Wrap, that supports weaving aspects into code at runtime. Aspects in Handi-Wrap take the form of method wrappers, which allow aspect code to be inserted around method bodies like advice in AspectJ. Handi-Wrap offers several advantages over static aspect languages such as AspectJ. First, aspects can be woven into binary libraries. Second, a wrapper in Handi-Wrap is a first-class Java value, which allows users to exploit Java mechanisms to define and weave wrappers. For example, wrappers can be passed explicit constructor arguments, and wrapper objects can be composed. Finally, methods in all Java classes, including anonymous classes, can be wrapped. A prototype of Handi-Wrap is implemented in a compile-time metaprogramming system for Java, called Maya; we briefly describe how Maya's features support Handi-Wrap.
Cited by 69 works. doi:10.1145/508386.508396
Authors
References
- Lecture Notes in Computer Science 1205
- Common LISP. The language
- Generative Programming: Methods, Tools, and Applications
- Making the future safe for the past
- Classes and mixins
- JAC: A Flexible Solution for Aspect-Oriented Programming in Java
- MultiJava
- JTS: tools for implementing domain-specific languages
- OpenJava: A Class-Based Macro System for Java
- Programming with Aspectual Components