Table of Contents

Reflex

Reflex is not an actively supported project anymore.

Reflex: Multi-Language AOP for Java

Reflex is a versatile kernel for multi-language AOP 2005-GPCE.

This means that Reflex provides, in the context of Java, building blocks for facilitating the implementation of different aspect-oriented languages so that it is easier to experiment with new AOP concepts and languages, and also possible to compose aspects written in different AOP languages. It is built around a flexible intermediate model, derived from reflection, of (point)cuts, links, and metaobjects, to be used as an intermediate target for the implementation of aspect-oriented languages. This is the level at which aspect interactions can be detected and resolved. Below this composition layer, a reflection layer implements the intermediate reflective model. Above the composition layer, a language layer, structured as a plugin architecture, helps bridge the gap between the aspect models and the intermediate model.

Architecture

The architecture of Reflex is as follows:

Portability and Dynamicity

In order to be portable, Reflex is implemented as a Java class library. It relies on Javassist to weave hooks in the base bytecode at load-time and connect these hooks to the metalevel, or to add structural elements (methods, classes) according to a Reflex configuration program. Part of this configuration can be modified at runtime through a dynamic configuration API.
Load-time configuration makes it possible to limit program transformation to the program points of interest (partial reflection with spatial selection). Runtime configuration makes it possible to activate/deactiveate the hooks (partial reflection with temporal selection), and access/change metaobjects.

An important property of Reflex is that the MOP of its underlying reflective layer is not fixed but can also be configured. This makes it possible to configure Reflex in order to support efficient static weaving but also makes it possible to support dynamic weaving (although a minimal overhead at the level of the hooks cannot be avoided after unweaving).

Evolution

Reflex first started as an open and portable system for behavioral reflection in Java 2001-Reflection, which then evolved to support a flexible model of partial behavioral reflection 2003-OOPSLA. As these experiments established clear connections between reflection and AOP (Aspect-Oriented Programming), this relation was further explored: this led to the proposal of AOP kernels 2004-EIWAS.

Language Plugins

Note: The information on plugins below can be considered outdated, since we developed a new plugin architecture, integrating the MetaBorg approach. The first experiment with this new approach to extensible language design is ReLAx, an extensible implementation of the KALA domain-specific aspect language for advanced transaction management.

The primitive means to configure Reflex are configuration classes. To raise the level of abstraction, plugins can be provided: a plugin supports an aspect language, and is in charge of generating the appropriate Reflex configuration.

As of today, two plugins are available for Reflex:

To run Reflex with a plugin, the plugin jar file must either be in the ./plugins directory, or in a directory specified by the reflex.config.plugins.path system property. It can also be specified on the command line using the –use <myplugin.jar> argument.

Documentation

Reflex documentation can be found here. Source code is mostly documented, and the distribution comes with a number of illustrative examples.

Publications are good high-level documents on the rationale behind Reflex, although precise APIs may be outdated.

Finally, there are mailing lists to discuss use and development of Reflex.

Download

Reflex is open source. At present it is distributed under the MIT license. You can get access to the latest source code on our Subversion Repository: http://pleiad.dcc.uchile.cl/svn/reflex/, using username guest and password guest. Otherwise you can get the latest snapshot made available: http://pleiad.dcc.uchile.cl/build/reflex-base/package-index.html.

Credits

Chief designer: Éric Tanter

Contributors (alphabetical order): Noury Bouraqadi, Denis Caromel, Pierre Cointe, Peter Ebraert, Alexis Herrera, Benoit Kessler, Luis Mateu, François Nollen, Jacques Noyé, Ángel Nuñez, José Piquer, Guillaume Pothier, Leonardo Rodríguez, Rodolfo Toledo, Michael Vernaillen.

This work was initially developed by Éric Tanter during his PhD thesis.

Also check the Reflex website at École des Mines de Nantes.

See Also

Acknowledgments

The best Java IDE