Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C2C6773D5 for ; Sat, 5 Nov 2011 15:21:28 +0000 (UTC) Received: (qmail 37909 invoked by uid 500); 5 Nov 2011 15:21:28 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 37822 invoked by uid 500); 5 Nov 2011 15:21:28 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 37814 invoked by uid 99); 5 Nov 2011 15:21:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Nov 2011 15:21:28 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of simone.tripodi@gmail.com designates 209.85.160.171 as permitted sender) Received: from [209.85.160.171] (HELO mail-gy0-f171.google.com) (209.85.160.171) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Nov 2011 15:21:24 +0000 Received: by gyg8 with SMTP id 8so5471495gyg.30 for ; Sat, 05 Nov 2011 08:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ytBhlKrxDPvcdaOVA/5/ZNPfECZPfXl2Xyxgqh7Etdo=; b=hjhKgWn03cYhquGisVlyQGNQIJpjCtw88hKIwT9pBtmsOhjdNbaURC90RgpdKZBYij 73CMGBh4MDhJIrQYgZ2mayZzUAcu+F9EKXSZvx5a5qfLpUcrTG6MinndgtBEicAwP0WL vR+5UoQNZtWgOX61BJ7VttjNKvqw7nlVuPtoc= MIME-Version: 1.0 Received: by 10.150.208.1 with SMTP id f1mr18166318ybg.60.1320506462826; Sat, 05 Nov 2011 08:21:02 -0700 (PDT) Sender: simone.tripodi@gmail.com Received: by 10.150.51.15 with HTTP; Sat, 5 Nov 2011 08:21:02 -0700 (PDT) In-Reply-To: References: <4EB3C4AA.4050009@sandglass-software.com> <4EB3CA75.6060801@sandglass-software.com> <4EB3CC7F.9000609@sandglass-software.com> <4EB3D75E.1030107@sandglass-software.com> Date: Sat, 5 Nov 2011 16:21:02 +0100 X-Google-Sender-Auth: AC3__9haBRBFyU2PH-vWJcI22I8 Message-ID: Subject: Re: [convert] API Discussion... From: Simone Tripodi To: Commons Developers List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi James! I like the idea, the concept reminds me how TestNG's DataProvider and GoogleGuice Providers. Looking forward to see it in action! Simo http://people.apache.org/~simonetripodi/ http://simonetripodi.livejournal.com/ http://twitter.com/simonetripodi http://www.99soft.org/ On Sat, Nov 5, 2011 at 3:48 PM, James Carman w= rote: > What if we introduce a @Converter annotation and any method that is > annotated with this annotation is automatically registered as a > converter? =C2=A0It's similar to what I've done in Metastopheles > (http://metastopheles.sourceforge.net/). > > On Fri, Nov 4, 2011 at 8:15 AM, Adrian Crum > wrote: >> Agreed. Please don't mis-interpret my replies - I'm not trying to "own" = the >> sandbox, I just want everyone to have a chance to play in it. >> >> The recent interest in Convert is great - I hope its popularity and >> usefulness grows. I'm truly looking forward to more people getting invol= ved. >> >> The current code base started out as a work I authored for the Apache Op= en >> For Business Project (OFBiz). The converter framework was used for OFBiz= 's >> scripting language. My initial work was built out and improved upon by a= n >> excellent team of developers. When the converter framework was fairly >> complete, someone suggested that OFBiz "spin off" the converter framewor= k to >> a separate library - so I brought it here to Commons. >> >> The code you see today is currently being used in an enterprise-class op= en >> source ERP application. It is scalable and thread-safe. >> >> Commons Convert has not been "fed back" to the OFBiz project yet because= it >> is still in the sandbox. Until a decent sized community grows around it,= the >> OFBiz community will not be willing to switch over to it. I hope to see = that >> switch happen someday. >> >> -Adrian >> >> On 11/4/2011 11:33 AM, James Carman wrote: >>> >>> A branch would work just fine for that situation. Also, let's keep in m= ind >>> that this component is in the sandbox >>> On Nov 4, 2011 7:28 AM, "Adrian Crum" >>> wrote: >>> >>>> Not so that someone else can commit them, so that others can review th= em >>>> and comment on them. >>>> >>>> -Adrian >>>> >>>> On 11/4/2011 11:25 AM, James Carman wrote: >>>> >>>>> If need be, I would just create a branch for my work. =C2=A0It would = be silly >>>>> for me to submit patches so that someone else would commit them >>>>> On Nov 4, 2011 7:20 AM, "Adrian Crum">>>> software.com> >>>>> wrote: >>>>> >>>>> =C2=A0 From my perspective, it would be preferable to keep the commun= ity >>>>>> >>>>>> involved >>>>>> in the design decisions. >>>>>> >>>>>> -Adrian >>>>>> >>>>>> On 11/4/2011 11:15 AM, James Carman wrote: >>>>>> >>>>>> =C2=A0I don't have to submit a patch. I am a commons committer >>>>>>> >>>>>>> On Nov 4, 2011 5:55 AM, "Adrian Crum">>>>>> >>>>>>> software.com >>>>>>> wrote: >>>>>>> >>>>>>> =C2=A0The source and target classes are used by the Converter.canCo= nvert >>>>>>> >>>>>>>> method. >>>>>>>> The Converter.canConvert method is used by the Converter factory t= o >>>>>>>> find >>>>>>>> the correct converter. The reason parameterized types are not used= in >>>>>>>> this >>>>>>>> scenario is so you can create converters that handle entire class >>>>>>>> hierarchies. If you can think of a way to replace the Class >>>>>>>> references >>>>>>>> with >>>>>>>> parameters, that would be great. Submit a patch and I will look it >>>>>>>> over. >>>>>>>> >>>>>>>> You could submit a patch for your partially-completed ConverterCha= in >>>>>>>> class >>>>>>>> and maybe someone else will complete it. >>>>>>>> >>>>>>>> -Adrian >>>>>>>> >>>>>>>> >>>>>>>> On 11/4/2011 2:19 AM, James Carman wrote: >>>>>>>> >>>>>>>> =C2=A0I was taking a look at the [convert] component because I hav= e done >>>>>>>> >>>>>>>>> some work lately on some handy conversion classes. =C2=A0I'm stru= ggling >>>>>>>>> to >>>>>>>>> understand why you'd need the getSourceClass() and getTargetClass= () >>>>>>>>> methods if you're using generics. >>>>>>>>> >>>>>>>>> >>>>>>>>> Also, I've got a class that looks like this: >>>>>>>>> >>>>>>>>> public class ConverterChain =C2=A0 =C2=A0 implements Convert= er >>>>>>>>> { >>>>>>>>> =C2=A0 public static =C2=A0 =C2=A0 ConverterChain =C2=A0 = =C2=A0 from(Class >>>>>>>>> =C2=A0sourceType); >>>>>>>>> =C2=A0 public =C2=A0 =C2=A0 ConverterChain =C2=A0 =C2=A0 = append(Converter >>>>>>>>> =C2=A0converter); >>>>>>>>> =C2=A0 ... >>>>>>>>> } >>>>>>>>> >>>>>>>>> I'd like to contribute it, but in my library, I don't have all of >>>>>>>>> those references to the class objects (source/target). =C2=A0I mi= ght >>>>>>>>> check >>>>>>>>> it in without the source/target stuff implemented. >>>>>>>>> >>>>>>>>> ------------------------------******--------------------------**-= -** >>>>>>>>> --**--------- >>>>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.****apac**he.org< >>>>>>>>> http://apache.org**> >>>>>>>>> < >>>>>>>>> >>>>>>>>> dev-unsubscribe@**commons.apache.org >>>>>>>>> For additional commands, e-mail: dev-help@commons.apache.org >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> =C2=A0------------------------------******-----------------------= ---**--** >>>>>>>>> >>>>>>>> --**--------- >>>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.****apac**he.org< >>>>>>>> http://apache.org**> >>>>>>>> = < >>>>>>>> >>>>>>>> dev-unsubscribe@**commons.apache.org >>>>>>>> For additional commands, e-mail: dev-help@commons.apache.org >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> =C2=A0------------------------------****--------------------------= --** >>>>>> >>>>>> --**--------- >>>>>> To unsubscribe, e-mail: >>>>>> dev-unsubscribe@commons.**apac**he.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 >>>> >>>> >> >> --------------------------------------------------------------------- >> 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 > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org