Metaproperty Aspects

Currently, it is possible to use aspect-oriented languages to attach behavior to code based on semantic or syntactic properties of that code. There is no existing language, however, that allows developers to attach behavior based on static metaproperties of code.

Metaproperty Aspects are a technique for applying AOP methods to metaproperties of source code. The familiar pointcut-advice model can be used to coherently define runtime behavior for subsets of code that need not share semantic or syntactic properties. Metaprop is a simple plugin for Eclipse that implements this technique in Java.

Metaprop

Getting and Installing Metaprop

Download the jar file(link) and place it in your eclipse plugins directory.

You will also need the plugins Bugdel and Javassist, available together from Bugdel's home page

Using Metaprop with a Project

Metaprop's weaving phase depends on several standard libraries. Configure the project classpath by adding these libraries as "external jars": Different versions of eclipse may require different libraries.

Configure the project file associations to use the Bugdel editor as the default editor for .java files.

Aspect weaving can be enabled or disabled from the "Metaproperty Aspect" item in the contextual menu for the project (right-click on project name in the Package Explorer tab). When off, aspect classes will be compiled as ordinary Java classes, but no weaving will be performed.

Note on Incremental Building

While aspect weaving is enabled, a change to any aspect or pointcut class requires the entire project to be rebuilt. Therefore, it may be convenient to disable automatic building.