commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@apache.org>
Subject Re: [proxy] sfl4j-like discovery for ProxyFactory...
Date Sat, 08 Mar 2008 23:14:47 GMT

On 08.03.2008, at 15:25, James Carman wrote:

> On 3/8/08, Torsten Curdt <tcurdt@apache.org> wrote:
>>
>>  On 08.03.2008, at 13:44, James Carman wrote:
>>
>>> All,
>>>
>>> The wicket folks are investigating using Commons Proxy and they  
>>> don't
>>> want to have to decide which implementation (jdk, cglib,  
>>> javassist) to
>>> use themselves.  They would like us to split up Commons Proxy into 3
>>> jars, commons-proxy, commons-proxy-cglib, commons-proxy-javassist.
>>> Any thoughts?
>>
>>
>> Is the discovery such a big problem with proxy? ...in general I
>>  prefer the static discovery type. But someone has to do it.
>
> Well, Johan makes a good case.  He's writing some code that he wants
> to use Proxy, but he doesn't want to have to figure out what
> implementation to use himself.  He'd rather it be done automatically
> for him, by doing something like ProxyFactory.getInstance().  I
> thought about this at one time.  I guess we could say, instantiate
> your class that's based on Proxy by passing in whatever implementation
> the client wants.  So, he could have something like:
>
> public class MyFrameworkClass
> {
>   public MyFrameworkClass(ProxyFactory proxyFactory)
>   {
>     this.proxyFactory = proxyFactory;
>   }
>
>   public Object createSomeKindOfProxy(SomeArgument arg)
>   {
>     return proxyFactory.create...
>   }
> }

Well, one could just try and see what classes are available in the  
classpath. This could be easily be done in a wrapper class as you  
suggested.

cheers
--
Torsten

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


Mime
View raw message