====== Reflex ====== Reflex is not an actively supported project anymore. ===== Reflex: Multi-Language AOP for Java ===== Reflex is a versatile kernel for multi-language AOP {{bib>tanterNoye:gpce2005|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: * The **transformation layer** is based on a reflective core extending Java with //behavioral// and //structural// reflective facilities. The model of behavioral reflection is based on that presented in {{bib>tanter:oopsla2003|2003-OOPSLA}}. * The **composition layer** ensures _automatic detection_ of aspect interactions, and provides expressive means for their //explicit resolution//. The composition facilities of Reflex were presented in [[2006-SC-2]], and recently, advanced mechanisms for declarative composition of structural aspects were introduced [2006-TR|[2006-SC]]. * The **language layer** is now based on the **[[http://www.stratego-language.org/Stratego/MetaBorg|MetaBorg]]** approach for unrestricted embedding and assimilation of domain-specific languages. Concrete syntax for the Reflex kernel API using this approach was presented in {{bib>tanter:odal2006|2006-ODAL}}. The **[[ReLAx]]** case study is the first experiment of a full-fledged domain-specific aspect language with this architecture. ==== Portability and Dynamicity ==== In order to be portable, Reflex is implemented as a Java class library. It relies on [[http://www.csg.is.titech.ac.jp/~chiba/javassist/|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 {{bib>TAN01|2001-Reflection}}, which then evolved to support a flexible model of //partial behavioral reflection// {{bib>tanter:oopsla2003|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 {{bib>tanterNoye:eiwas2004|2004-EIWAS}}. ===== Language Plugins ===== **Note**: The information on plugins below can be considered outdated, since we developed a new plugin architecture, integrating the [[http://www.stratego-language.org/Stratego/MetaBorg|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 [[research:software:reflex:documentation:Link_Providers_and_Configuration_Classes|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: * [[research:software:ajp|AspectJ Plugin]]: implements a subset of AspectJ {{bib>toledoTanter-jucs2008|2008-JUCS}}. * [[research:software:som|SOM plugin]]: implements a domain-specific aspect language for SOM, Sequential Object Monitors {{bib>som:ecoop2004|2004-ECOOP}}. 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 argument. ===== Documentation ===== *[[research:software:reflex:documentation|Documentation]] *[[research:software:reflex:publications|Publications]] Reflex documentation can be found [[Research:Software:Reflex:Documentation|here]]. Source code is mostly documented, and the distribution comes with a number of illustrative examples. [[research:software:reflex:publications|Publications]] are good high-level documents on the rationale behind Reflex, although precise APIs may be outdated. Finally, there are [[http://reflex.dcc.uchile.cl/mailman/listinfo/reflex|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 [[http://www.dcc.uchile.cl/~etanter|Éric Tanter]] during his [[Publications|PhD thesis.]] Also check the [[http://www.emn.fr/x-info/reflex/|Reflex website]] at École des Mines de Nantes. ===== See Also ===== * [[research:software:ReflexD]]: ReflexD is a versatile kernel for distributed AOP in Java. ReflexD is implemented as an extension of Reflex, making use of Reflex itself and Java RMI as a base for remote invocation. * [[research:software:ReLAx]]: ReLAx is the implementation of the KALA domain-specific aspect language on top of Reflex. * [[research:software:SOM]]: SOM (Sequential Object Monitors) is a model for concurrent programming based on a thread-less scheduler. * [[research:software:POM]]: POM (Parallel Object Monitors) is a concurrency abstraction for the coordination of parallel activities over single objects and groups of objects in shared memory systems. It allows a clean separation of the coordination concern from the base application code. * [[research:software:AJP]]: AspectJ plugin for Reflex * [[research:software:Classboxes]]: Reflex-based implementation and JastAddJ-based compiler for Classboxes ===== Acknowledgments ===== The best Java IDE