commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@gmail.com>
Subject Re: [proxy] Changing the API to an interface (AGAIN)...
Date Fri, 16 Jul 2010 22:42:50 GMT

On Jul 16, 2010, at 4:58 PM, James Carman wrote:

> On Fri, Jul 16, 2010 at 5:48 PM, Matt Benson <gudnabrsam@gmail.com> wrote:
>> Consider it done, then.  :)
>> 
>> Poor birds.
>> 
> 
> Sorry, my wife has that "angry birds" application on her ipod touch,
> so I've been on a bird killing spree for the past few weeks.
> 

Just kidding around.  Anyway, I did just recall a trick I've learned from the Bean Validation
podling code:  you don't necessarily have to pass in a reference to the class, so we could
theoretically just have, e.g.:

<T> T createDelegatorProxy( ObjectProvider<?> delegateProvider, Class<?>...
proxyClasses );

and, e.g.

Foo foo = proxyFactory.createDelegatorProxy(whocares, Foo.class, Bar.class) would compile
properly.  The only drawback to this is that there is no requirement that Foo.class actually
*be* one of the arguments to the method.  At this point we would be relying on the client
to do the right thing; if not he gets a classcastexception.  But the payoff is that we get
single-arg/return-type and varargs/array processing from a single varargs method.

WDYT?

-Matt

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


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


Mime
View raw message