You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Daniel Fagerstrom <da...@nada.kth.se> on 2007/08/19 20:16:32 UTC

Re: svn commit: r567436 - in /cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl: ./ src/main/java/org/apache/cocoon/components/pipeline/spring/ src/main/resources/META-INF/cocoon/spring/

gkossakowski@apache.org skrev:
> Author: gkossakowski
> Date: Sun Aug 19 10:28:30 2007
> New Revision: 567436
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=567436
> Log:
> COCOON-2122: Implemented pipeline component custom scope. Added dependency on cglib because <aop:scoped-proxy/> element needs it.

cglib was required in early versions of Spring 2.0 but not anymore, you 
can use:

   <aop:scoped-proxy proxy-target-class="false"/>

which will use ordinary Java proxies instead. The limitation is that the 
  proxied object need to implement an inteface. While having an extra 
possibly unmotivated interface is a little bit inconvenient, I find it 
prefarable as it saves us from the added complications byte code 
engeneering.

/Daniel

Re: svn commit: r567436 - in /cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl: ./ src/main/java/org/apache/cocoon/components/pipeline/spring/ src/main/resources/META-INF/cocoon/spring/

Posted by Joerg Heinicke <jo...@gmx.de>.
On 19.08.2007 14:51 Uhr, Grzegorz Kossakowski wrote:

> Adding extra (unnecessary in this case) interface was the reason why I 
> tried to experiment with cglib. Due to problems while debugging I was 
> going to give up it, your comment convinced me even more.

CGLib is supposed to be faster than JDK dynamic proxies, but debugging 
them is indeed a real pain. Additionally classes that should be proxied 
with CGLib need a default constructor - what clashes with my preference 
for constructor injection. That's why I mostly use JDK dynamic proxies.

Joerg

Re: svn commit: r567436 - in /cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl: ./ src/main/java/org/apache/cocoon/components/pipeline/spring/ src/main/resources/META-INF/cocoon/spring/

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Daniel Fagerstrom pisze:
> 
> cglib was required in early versions of Spring 2.0 but not anymore, you 
> can use:
> 
>   <aop:scoped-proxy proxy-target-class="false"/>
> 
> which will use ordinary Java proxies instead. The limitation is that the 
>  proxied object need to implement an inteface. While having an extra 
> possibly unmotivated interface is a little bit inconvenient, I find it 
> prefarable as it saves us from the added complications byte code 
> engeneering.

Adding extra (unnecessary in this case) interface was the reason why I tried to experiment with 
cglib. Due to problems while debugging I was going to give up it, your comment convinced me even more.

Thanks for keeping eye on my commits. I hope you like my approach.

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/