Commons Proxy would definitely help abstract away practically all of
the proxying logic from Guice (you'd still have to decide what to pass
into the API, obviously).  It has support for aopalliance interceptors
out of the box, so you wouldn't have to jump through any hoops to get
that working.  If a Guice project only uses interfaces for their
"services", then they could just use Commons Proxy with no
dependencies and just use JDK proxies (it'd be slower, but if speed
isn't an issue...).

I wrote Commons Proxy with dependency injection in mind.  While
working on the HiveMind project, I really hated doing all of that
Javassist programming necessary for writing your own interceptors and
stuff.  I decided to write the logic one time and allow "hooks" for
the proxying logic instead.  Once I abstracted stuff out, I decided to
start implementing it using different dynamic proxy libraries.  As for
the maintenance, it really hasn't needed much maintenance because
there aren't that many folks using it, yet.  I would imagine that it's
partly because nobody really knows about it (that's what I keep
telling myself so that I don't think all my hard work was for nothing
:).

On Mon, Oct 20, 2008 at 11:06 PM, Gili Tzabari <[EMAIL PROTECTED]> wrote:
>
>
>    I've only personally played around with JDK proxies, ASM and CGLIB
> (so no ideas about the other ones). Personally I would advocate using
> any API that simplifies the code and has good documentation. For
> example, last time I checked CGLIB had horrible (practically
> nonexistent) documentation and ASM wasn't the easiest thing in the world
> to use (though the documentation was a lot better). If Apache Commons
> Proxy improves on both fronts (usability, documentation) it would be
> worth using in my view. I'm not sure whether it does though or how well
> it is maintained.
>
> Gili
>
> [EMAIL PROTECTED] wrote:
>> On Oct 16, 10:42 pm, "James Carman" <[EMAIL PROTECTED]> wrote:
>>
>>> Would the Google Guice project be interested in using Apache Commons
>>> Proxy (http://commons.apache.org/proxy/)? ACP basically allows you to
>>> create dynamic proxy objects using a standardized API without worrying
>>> about the underlying dynamic class library specifics.  Right now, it
>>> includes support for JDK proxies, Javassist, and CGLIB (no ASM yet,
>>> but I imagine it could be done).
>>>
>>
>> Honest question: how would this make our code better?
>> >
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to