geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jules Gosnell <ju...@coredevelopers.net>
Subject Re: bytecode interceptors
Date Tue, 02 Dec 2003 12:53:17 GMT
James Strachan wrote:
> Saw this in the blogosphere today...
> 
> http://kasparov.skife.org/blog/2003/12/01#thank-you-chris
> 
> thought it looked interesting.  I wonder if we could look at integrating 
> this kind of feature ('baking' an interceptor stack into bytecode)

I've given this some thought...

I see three approaches with respective pros/cons...

1. Fully Dynamic - the current (as I understand it) approach

pros:

it's the most flexible

cons:

it's complex
it's dynamic (with associated overheads)


2. Aspected (requiring weaving at ClassLoading time)

pros :

much simpler - boilerplate is delegated to the Aspect community
it's static - should be faster and use less memory

cons:

possibly less flexible (it would be awkward to have an interceptor that 
changed it's stack's target object - although this could be achieved 
with the addition of a single layer of wrapping - maybe via (3)).


3. Just-in-time interceptor-baking :-)

pros :

preserves flexibility of (1)
interceptors could be baked with static interfaces, faster
there might be opportunities to bake an optimised stack to reduce the 
number of objects used.

cons :

probably the most complex solution....


Personally, I favour the Aspect approach. If this proved a little 
inflexible it could be augmented with one of the other approaches as and 
when necessary. The Aspect community have put a lot of work into this 
area and I think that Geronimo interceptors could benefit from this. My 
only concern is that aspects are currently not standardised. This makes 
picking a particular impl a risk.


Jules


> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 


-- 
/**********************************
  * Jules Gosnell
  * Partner
  * Core Developers Network (Europe)
  **********************************/


Mime
View raw message