« AspectWerkz - Simple, high-performant, dynamic, lightweight and powerful AOP for Java | Main | JBoss AOP - Organizing Cross Cutting Concerns »

Nanning Aspects - Java Framework





Nanning Aspects is a simple yet scaleable aspect-oriented framework for Java.

Nanning is also nice "little" town in Guanxi province in southern China. It's about 1-2 million inhabitants which barely qualifies it as a town by chinese standards. It is not to be confused with the much larger Nanking/Nanjing.

Nanning Features:

Nanning Aspects has the following features:

* An aspected object consists of a set of mixins. Every mixin is an interface, a target-object and a set of interceptors (advises on method-calls), these interceptors intercept calls on the interface on it's way to the target.
* An aspected object is used by creating a Proxy with the Reflection API. This proxy will implement all the interfaces of all the mixins by invoking all the interceptors for the called method and finally calling the proper implementation of the target object.
* Attributes (as Javadoc-like tags in the source code or as an xml-document with the same name as the class) can also be added to classes, fields and methods. These attributes are accesible at runtime.
* Inherited interfaces will call correct target. If several aspects implement same interface the first one will take precedence. The target of the aspect-class will always take precedence before the rest.
* An XML-config format that's actually a Jelly-script .
* Method-selectors that selects what methods an interceptor should intercept.
* Super-simple implementation. Really! Anybody can do it!

Nanning Restrictions

Nanning Aspects has the following restrictions

* You can only advise on method-call pointcuts which is far from the power that for example AspectJ offers. On the other hand compared to the complexity of AspectJ Nanning is much, much simpler. In reality many of the benefits of AOP can be reached with this simple construct. At the moment there is also some experimental support for intercepting object-instantiation.
* All your objects need to have interface and implementation separated, that is all public methods (accessible to clients) needs to be placed in an interface which is implemented by the actual class. In contrast to EJB your implementation must implement the interface, which also forces your implementation to stay in sync with your interface. (This is actually good, because the java-compiler will choke if they're out of sync before your code even hits unit-tests.)
* You'll get indeterministic effects if your interface has a method with same name as a method of another interface for the aspected object. (Currently considering disallowing this altogether.)


Most documentation is located at our SnipSnap http://nanning.snipsnap.org . It's an ongoing effort.

Download Nanning
http://nanning.codehaus.org/download.html

TrackBack

TrackBack URL for this entry:
http://freejdk.org/mt-tb.cgi/39