You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Josh Canfield <jo...@gmail.com> on 2011/02/04 00:40:23 UTC

Service and Component advice differences

Maybe this is obvious to the masses, but when you advise a service
method, your advice is only triggered when called from the proxy
returned by the registry. This means that if you want to advise a
method that gets called internally by that same class the advice is
not triggered.

When you advise a component/page method your advice is called whenever
that method is called. So if you call an advised method from an
unadvised method you still get your advice triggered.

I realize that this is because page/components are actually using
re-written byte code, and services are just proxies fronting the
original byte code, but I'm wondering if any one has that about doing
something about that?


Josh

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


Re: Service and Component advice differences

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 03 Feb 2011 21:40:23 -0200, Josh Canfield <jo...@gmail.com>  
wrote:

> I realize that this is because page/components are actually using
> re-written byte code, and services are just proxies fronting the
> original byte code, but I'm wondering if any one has that about doing
> something about that?

I've never checked that, but would it be possible for the proxies be  
decorators, subclassing the original service object? I guess this could  
solve this problem. Howard's new bytecode generation package could help.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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