You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by Howard Lewis Ship <hl...@gmail.com> on 2005/07/02 22:50:43 UTC

Re: About Interception

The Javassist approach is very powerful and minimizes both reflective
access and memory useage.  It also means that Hotspot can get in there
are optimize things in a way not so possible with proxies.

The full story, of course, involves Tapestry.  Tapestry was already
using Javassist to enhance abstract classes, and I was able to
re-forumulate much of that behavior into HiveMind.  It does come down
to "whatever works for you" however, and the APIs are agnostic.

The bytecode approach was very useful when it came to getting beans
(w/o interfaces) working with interception.

On 7/1/05, James Carman <ja...@carmanconsulting.com> wrote:
>  
>  
> 
> I was trying to find the benchmark that he did a while back.  But, I
> couldn't.  Howard, can you point us to the right URL? 
> 
>   
>  
>  ________________________________
>  
> 
> From: belaran [mailto:belaran@gmail.com] 
>  Sent: Friday, July 01, 2005 8:40 AM
>  To: James Carman
>  Subject: Re: About Interception 
> 
>   
> 
> Well, i don't actually want to use javassist, I wanted to know how HM does
> when you ask to intercept something. But you very right, i never thought to
> compare this "performance problem" with the other "delays"... 
>  I'll be interested in the benchmark anyway...
>  
>  
>  
>  
> 
> 2005/7/1, James Carman <ja...@carmanconsulting.com>: 
>  
> 
> Howard actually did do a benchmark comparison and it was true that
> javassist-based proxies are faster, but in the grand scheme of things, I
> question how much this really means.  For example, if the method that's
> being intercepted does a database query, the time difference it takes to
> intercept the method using proxies as opposed to javassist compared to the
> time it takes to perform the query is probably negligible.  That's my $0.02.
>  I believe in the three Rs.  Make it run.  Make it right.  Make it rip.  So,
> if you don't have an issue with performance, why introduce the complexity of
> Javassist? 
> 
>   
>  
>  ________________________________
>  
> 
> From: belaran [mailto: belaran@gmail.com] 
>  Sent: Friday, July 01, 2005 8:27 AM
>  To: James Carman
>  Subject: Re: About Interception 
>  
> 
>   
> 
> You could hard-code your interceptor if you want to.
>  
>  I agree, on code level it has no importance how HiveMind implments the
> interception.... On the run-time i believe that rewriting the class on load
> is far more efficient than using proxies, so that's why i'm asking...
>  
>  Of course, i know we lack of benchmark about it, so there is no real proof
> of it... anyway, i would like to know how it's work... 
>  
> 
> 2005/7/1, James Carman < james@carmanconsulting.com>:
>  
>  
> 
> It does both.  And, it doesn't matter how you implement it.  You could
> hard-code your interceptor if you want to.  All you have to do is put an
> object onto the "interceptor stack" which implements the service interface. 
> 
>   
>  
>  ________________________________
>  
> 
> From: belaran [mailto: belaran@gmail.com ] 
>  Sent: Friday, July 01, 2005 6:37 AM
>  To: hivemind-user@jakarta.apache.org
>  Subject: About Interception 
>  
> 
>   
> 
> Hi !
>  
>  Reading spring documentation, and checking some stuff on HiveMind, i
> realized i may have made a very wrong assumptions about HiveMind's
> interception.
>  I believed that HiveMind's interceptions was based on the use of proxy
> however, when i read the description of JavAssist I realize that may not be
> the case...
>  
>  Does HiveMind rewrite bytescode or does it use proxy to implements
> interception ?
>  -- 
>  Belaran,
>  "What'do'ya mean ?"
>  "As a moto, I just avoid meaning anything..." 
>  
> 
> 
>  
>  
>  -- 
>  Belaran,
>  "What'do'ya mean ?"
>  "As a moto, I just avoid meaning anything..." 
>  
> 
> 
>  
>  
>  -- 
>  Belaran,
>  "What'do'ya mean ?"
>  "As a moto, I just avoid meaning anything..." 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org