From dev-return-108488-apmail-commons-dev-archive=commons.apache.org@commons.apache.org Mon Apr 07 18:34:21 2008 Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 30954 invoked from network); 7 Apr 2008 18:34:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Apr 2008 18:34:21 -0000 Received: (qmail 98477 invoked by uid 500); 7 Apr 2008 18:34:19 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 98406 invoked by uid 500); 7 Apr 2008 18:34:19 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 98397 invoked by uid 99); 7 Apr 2008 18:34:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Apr 2008 11:34:19 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [203.89.192.138] (HELO postoffice2.aconex.com) (203.89.192.138) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Apr 2008 18:33:28 +0000 X-ASG-Debug-ID: 1207593220-20df01610000-ZueItg X-Barracuda-URL: http://intranex.aconex.com:8000/cgi-bin/mark.cgi Received: from postoffice.aconex.com (localhost [127.0.0.1]) by postoffice2.aconex.com (Spam Firewall) with ESMTP id C1C1550BC51 for ; Tue, 8 Apr 2008 04:33:40 +1000 (EST) Received: from postoffice.aconex.com (postoffice.yarra.acx [192.168.3.1]) by postoffice2.aconex.com with ESMTP id fAF9Urh5blurUz32 for ; Tue, 08 Apr 2008 04:33:40 +1000 (EST) Received: from [10.1.1.152] (123-243-122-218.static.tpgi.com.au [123.243.122.218]) by postoffice.aconex.com (Postfix) with ESMTP id 6362892C1F8 for ; Tue, 8 Apr 2008 04:33:40 +1000 (EST) Message-ID: <47FA6900.8050000@funkwit.com> Date: Tue, 08 Apr 2008 04:33:36 +1000 From: Paul Cowan User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Jakarta Commons Developers List X-ASG-Orig-Subj: Re: [proxy] Proxy & Generics... Subject: Re: [proxy] Proxy & Generics... References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: postoffice.yarra.acx[192.168.3.1] X-Barracuda-Start-Time: 1207593220 X-Barracuda-Virus-Scanned: by Aconex Staff Email Spam Firewall at aconex.com X-Virus-Checked: Checked by ClamAV on apache.org Hi James, James Carman wrote: > public Object createDelegatorProxy( ObjectProvider delegateProvider, > Class... proxyClasses ); > > However, I also want to add in a nice helper method like this: > > public T createDelegatorProxy( ObjectProvider delegateProvider, > Class proxyClass ); I'm not overly familiar with proxy, but will this work? public T createDelegatorProxy(ObjectProvider delegateProvider, Class primaryProxyClass, Class... otherProxyClasses); That combines the generic version and the non-generic version into one method, with generics for people who pass one Class and beyond that no generics are used. It's not QUITE the same as your two methods... firstly you have to commit to passing an ObjectProvider of the same type as the first class (which may make for a confusing API? not sure) and it also means you HAVE to pass at least one proxy class, you can't just call createDelegatorProxy(delegateProvider); which your varargs methods let you do. I don't know if that's a good thing or a bad thing in this case? Just an idea, anyway. Cheers, Paul --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org