You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Neeme Praks <ne...@apache.org> on 2002/12/11 09:11:15 UTC

[fortress / excalibur] JDK 1.2 dynamic proxies: implementation question, to CGLIB or...

When implementing dynamic proxies for JDK 1.2, we have two choices:
1. I have cooked up an implementation for generating dynamic proxy 
classes with BCEL, but it still needs some more work to make it ready 
for production use.
2. use CGLIB (http://sourceforge.net/projects/cglib). CGLIB has more 
robust implementation of dynamic proxies with all the support 
infrastructure (also uses BCEL). Plus, they have some other advanced 
functionality as well (support for proxying any non-final java class, 
not just interfaces, Enhancer - intercept all method calls, Delegator - 
combine any number of objects into one big object and delegate the 
method calls).

I would personally prefer to use CGLIB. They have Apache license, so the 
legal issues should not be an obstable.
If we choose to use CGLIB, then I would most probably try to help them 
out, to test and document their code more.

BTW, does anyone know about the line I would in CGLIB build.xml file?:
------------------------------------------------------------------------
"cglib"  was   "simplestore" component of the Jakarta Commons Subproject
------------------------------------------------------------------------
Was it really part of Jakarta Commons? Why did it leave?
I would really like to have that project under Apache umbrella, under 
BCEL or whereever. BCEL doesn't seem to have much of community so it 
would make sense to move it there, to increase the community (there are 
currently 4 developers working on CGLIB) and provide some useful 
implementations on top of BCEL... Or am I just dreaming here...?

bcel-dev seems to be almost dead (and I thought that Avalon had 
community issues), my speculative proposal to investigate the 
possibilities for merging these two projects did not receive any 
response from BCEL developer(s)...

Rgds,
Neeme




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [fortress / excalibur] JDK 1.2 dynamic proxies: implementation question, to CGLIB or...

Posted by Peter Donald <pe...@realityforge.org>.
On Mon, 16 Dec 2002 20:30, Neeme Praks wrote:
> Chris (one of the CGLIB developers) wrote to me this:
>  > Also, I'm not sure what led to Peter's concerns, but the library
>  > actually goes to quite some trouble to make the creation and execution
>  > of the generated code as fast as possible, through proper caching,
>  > etc. The jar itself is only 60k not including BCEL.
>
> So, I would prefer using CGLIB and improve that if there are places for
> improvement. Anyway, CGLIB seems to have at least a "community" around
> it, developing and maintaining it. All code in BCEL seems to be pretty
> much frozen...

Thats fine with me - I just have used BCEL before and could maintain the code 
whereas with CGLIB it will probably be up to you to do it. I have never 
looked at CGLIB properly so it may be just as easy but I aint gonna volunteer 
to do the work - if you are then go for it ! ;)

It would be great to kill ECM dead - finally!

> Well, if there are some other projects (like CGLIB) that could be in the
> BCEL scope, then I think that the code should have been moved to BCEL
> instead... But probably it was thought to be out-of-scope for BCEL...

No idea. Always possible to make noise on BCEL and/or general lists and it may 
spark a fire ... or may not.

-- 
Cheers,

Peter Donald
------------------------------------------------
 "No. Try not. Do. Or do not. There is no try." 
                                     -- Yoda 
------------------------------------------------ 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [fortress / excalibur] JDK 1.2 dynamic proxies: implementation question, to CGLIB or...

Posted by Chris Nokleberg <ch...@sixlegs.com>.
On Mon, Dec 16, 2002 at 11:30:27AM +0200, Neeme Praks wrote:
> >>Was it really part of Jakarta Commons?
> >I think so (at least it has the same authors).
> >>Why did it leave?
> >good question.
> 
> Nobody knows? I couldn't find anything in the commons-dev list archives 
> either... Chris, can you fill in here?

It was before my time, but far as I can tell from the archives, people
from a number of projects thought it would be useful (commons
lang/reflect/whatever) but no one wanted a dependency on BCEL. The BCEL
committers didn't want to hand out cvs access, and didn't take the
opportunity to pull it from commons-sandbox when it was offered. Juozas,
is that a fair summary?

-Chris

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [fortress / excalibur] JDK 1.2 dynamic proxies: implementation question, to CGLIB or...

Posted by Neeme Praks <ne...@apache.org>.
Peter Donald wrote:

> On Wed, 11 Dec 2002 19:11, Neeme Praks wrote:
>
> >When implementing dynamic proxies for JDK 1.2, we have two choices:
> >1. I have cooked up an implementation for generating dynamic proxy
> >classes with BCEL, but it still needs some more work to make it ready
> >for production use.
>
> I would prefer this because I assume it is small and lightweight and 
> does not
> have any overhead but poking through CGLIB looks like it does.
>
> However it is up to you. If you don't want to support the code or 
> can't get it
> into BCEL or whatever then CGILIB may be an option. However if we go that
> path I would prefer that CGILIB only got used under jdk1.2 and native 
> proxys got used in jdk1.3+

Well, we can do some performance testing later...
Chris (one of the CGLIB developers) wrote to me this:
 > Hi again Neeme,
 >
 > Saw your message to avalon-dev (I read the archives of a lot of apache
 > lists :-). Any help with documentation and testing of CGLIB would be
 > appreciated, if you decide to use it.
 >
 > Also, I'm not sure what led to Peter's concerns, but the library
 > actually goes to quite some trouble to make the creation and execution
 > of the generated code as fast as possible, through proper caching,
 > etc. The jar itself is only 60k not including BCEL.

So, I would prefer using CGLIB and improve that if there are places for 
improvement. Anyway, CGLIB seems to have at least a "community" around 
it, developing and maintaining it. All code in BCEL seems to be pretty 
much frozen...

> >Was it really part of Jakarta Commons?
> I think so (at least it has the same authors).
> >Why did it leave?
> good question.

Nobody knows? I couldn't find anything in the commons-dev list archives 
either... Chris, can you fill in here?

> BCEL doesn't have a community and never has (even pre-Apache days). It 
> came to
> Apache ready made and of high enough quality that no one really needs 
> to change it much. Theres a lot of users but thats about it.

Well, if there are some other projects (like CGLIB) that could be in the 
BCEL scope, then I think that the code should have been moved to BCEL 
instead... But probably it was thought to be out-of-scope for BCEL...

Rgds,
Neeme


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [fortress / excalibur] JDK 1.2 dynamic proxies: implementation question, to CGLIB or...

Posted by Peter Donald <pe...@realityforge.org>.
On Wed, 11 Dec 2002 19:11, Neeme Praks wrote:
> When implementing dynamic proxies for JDK 1.2, we have two choices:
> 1. I have cooked up an implementation for generating dynamic proxy
> classes with BCEL, but it still needs some more work to make it ready
> for production use.

I would prefer this because I assume it is small and lightweight and does not 
have any overhead but poking through CGLIB looks like it does. 

However it is up to you. If you don't want to support the code or can't get it 
into BCEL or whatever then CGILIB may be an option. However if we go that 
path I would prefer that CGILIB only got used under jdk1.2 and native proxys 
got used in jdk1.3+

> Was it really part of Jakarta Commons? 

I think so (at least it has the same authors).

> Why did it leave?

good question.

> I would really like to have that project under Apache umbrella, under
> BCEL or whereever. BCEL doesn't seem to have much of community so it
> would make sense to move it there, to increase the community (there are
> currently 4 developers working on CGLIB) and provide some useful
> implementations on top of BCEL... Or am I just dreaming here...?

BCEL doesn't have a community and never has (even pre-Apache days). It came to 
Apache ready made and of high enough quality that no one really needs to 
change it much. Theres a lot of users but thats about it.

-- 
Cheers,

Peter Donald
---------------------------------------------------
Murphy's law - "Anything that can go wrong, will." 
(Actually, this is Finagle's law, which in itself 
shows that Finagle was right.)
---------------------------------------------------


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>