Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-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 C61CC110CF for ; Tue, 3 Jun 2014 02:14:42 +0000 (UTC) Received: (qmail 29552 invoked by uid 500); 3 Jun 2014 02:14:42 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 29491 invoked by uid 500); 3 Jun 2014 02:14:42 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 29481 invoked by uid 99); 3 Jun 2014 02:14:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2014 02:14:42 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of garydgregory@gmail.com designates 209.85.220.48 as permitted sender) Received: from [209.85.220.48] (HELO mail-pa0-f48.google.com) (209.85.220.48) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2014 02:14:39 +0000 Received: by mail-pa0-f48.google.com with SMTP id fb1so1788055pad.35 for ; Mon, 02 Jun 2014 19:14:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=9DWlNWvFf0CxgIZLyX+OfZmrUmkDV09EmWTMI0dGn4I=; b=L84v6EFzEmiyjWYqifTHxgTJYsBs0SAeQWZXdsRcsAmnDt5bcb01eDm8BNaqSZO1SI Ma9yJbVclAGbfjwfPYqZIjTQC/4FBxoqtNl9i8xaxfIAbm0f0GjJBGsSuHc4nOou3l/y khRBn4Xvg0d00GFAfXgrjci9RbWK+PINLDfK8L5yJKjYvAoD7y8+psOhveBFe7hukmaf dASsd5z72xS6VT+fibvS1rKtAyB3+VB4kXgDhZ1z97ZQ6iCZHbf5BbcpQ40PkxmzUsAc eKr+Hg8XIktzFB/pdN4kqED3d3whCY0uA8/BtMupmXP5Z7n2mTdfH8Zgb4cu+zJffyHZ eojw== MIME-Version: 1.0 X-Received: by 10.68.201.97 with SMTP id jz1mr45970365pbc.26.1401761654431; Mon, 02 Jun 2014 19:14:14 -0700 (PDT) Received: by 10.70.127.196 with HTTP; Mon, 2 Jun 2014 19:14:14 -0700 (PDT) In-Reply-To: References: <6EF821BA-6CD1-4FB5-9081-8956A39164F8@gmail.com> Date: Mon, 2 Jun 2014 22:14:14 -0400 Message-ID: Subject: Re: Registering converters From: Gary Gregory To: Log4J Developers List Content-Type: multipart/alternative; boundary=047d7b15ac5978e3de04fae511d9 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b15ac5978e3de04fae511d9 Content-Type: text/plain; charset=UTF-8 On Mon, Jun 2, 2014 at 10:08 PM, Matt Sicker wrote: > On 2 June 2014 20:59, Gary Gregory wrote: > >> If your builder has a triplet of ivar/getter/setter for each factory >> parameter, then it's more code and more "complicated" than a single factory >> method with paramters. IMO. YMMV. The problem here is that I do want to be >> forced into one configuration style but OTOH I do not think it is good for >> us to provide two or three styles to do the same thing. We need to pick >> one. It' bad enough we have three different configuration file syntax >> formats. >> > > The builders have setters only (which return this at the end of each one). > The fields themselves are used for getting the values. Really, the builders > are basically auto-generated setters for the most part. I think Groovy has > an easier way to do this via closures, but that's not really useful for us. > > To to follow the rest of Log4j, I could have a class with a bunch static >> inner classes all annotated with something like @TypeConverter and that >> would be it? >> > > So scan for a new annotation? Or just re-use @Plugin on the class with a > category like "TypeConverters" or similar? > Well, my point is that you'd just use an annotation. What the annotation is, I do not know. I'm not crazy about the category idea in general because I am one typo away on a late night from getting stuck. If the code does not compile, that's easier to fix. Gary > > -- > Matt Sicker > -- E-Mail: garydgregory@gmail.com | ggregory@apache.org Java Persistence with Hibernate, Second Edition JUnit in Action, Second Edition Spring Batch in Action Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory --047d7b15ac5978e3de04fae511d9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On M= on, Jun 2, 2014 at 10:08 PM, Matt Sicker <boards@gmail.com> w= rote:
=
On 2 June 2014 20:59, Gary Grego= ry <garydgregory@gmail.com> wrote:
=
If your builder has a triplet of ivar/gette= r/setter for each factory parameter, then it's more code and more "= ;complicated" than a single factory method with paramters. IMO. YMMV. = The problem here is that I do want to be forced into one configuration styl= e but OTOH I do not think it is good for us to provide two or three styles = to do the same thing. We need to pick one. It' bad enough we have three= different configuration file syntax formats.

The builders= have setters only (which return this at the end of each one). The fields t= hemselves are used for getting the values. Really, the builders are basical= ly auto-generated setters for the most part. I think Groovy has an easier w= ay to do this via closures, but that's not really useful for us.

To to follow th= e rest of Log4j, I could have a class with a bunch static inner classes all= annotated with something like @TypeConverter and that would be it?

So scan for = a new annotation? Or just re-use @Plugin on the class with a category like = "TypeConverters" or similar?

Well, my point is that you'd just use an annotation= . What the annotation is, I do not know. I'm not crazy about the catego= ry idea in general because I am one typo away on a late night from getting = stuck. If the code does not compile, that's easier to fix.

Gary
=C2=A0

--
Matt Sicker <boards@gmail.com>



--
--047d7b15ac5978e3de04fae511d9--