[jboss-dev-forums] [Design of JBossCache] - JBossCache 2.1.0 - AOP framework

manik.surtani@jboss.com do-not-reply at jboss.com
Fri Jul 6 07:38:03 EDT 2007


The current (1.4.x and 2.0.0) versions of JBoss Cache used hand-wired interceptor chains to apply aspects to the underlying data structure.  E.g., a put() call on the cache would:

1)  Use a Method representing an internal equivalent of put(), and pass this along with parameters (wrapped in a MethodCall object) up an interceptor chain.
2)  The interceptor chain would apply an aspect to the call and pass the call up.
3)  The final interceptor would use reflection and invoke the MethodCall on the cache again.

I think there is good cause to replace this with a more sophisticated AOP framework:

1)  Writing/maintaining our own interceptor handling code is unnecessary and boiler-plate
2)  An AOP fwk would mean that the interceptors can be applied to other objects as well, not just Cache (e.g., Node)
3)  We can do away with the myriad of public "internal" method counterparts to public API methods on the cache - as these are otherwise open to misuse.
4)  Allow for end users to add their own aspects (*)

(*)  This may not be a good thing.

The criteria I need to think about when picking an AOP framework are:

1)  Efficiency - our use case of the fwk is not a complex one.  The fwk should be able to handle this very efficiently.
2)  Bloat - footprint should be small and not bring in (too big) a chain of dependencies.
3)  Readability/maintainability/debuggability - this is part of the reason I want to move away from the current design in the first place.

I haven't spent a whole lot of time evaluating frameworks yet, and hence this thread to discuss the pros and cons of various frameworks/approaches out there - including the "don't change the current setup" approach. 

Cheers,
Manik

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061238#4061238

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061238



More information about the jboss-dev-forums mailing list