Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-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 6D9EB6B43 for ; Tue, 24 May 2011 17:45:53 +0000 (UTC) Received: (qmail 4501 invoked by uid 500); 24 May 2011 17:45:53 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 4451 invoked by uid 500); 24 May 2011 17:45:53 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 4443 invoked by uid 99); 24 May 2011 17:45:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 May 2011 17:45:53 +0000 X-ASF-Spam-Status: No, hits=1.8 required=5.0 tests=HTML_FONT_FACE_BAD,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of webmaster@fernandoribeiro.eti.br designates 209.85.214.45 as permitted sender) Received: from [209.85.214.45] (HELO mail-bw0-f45.google.com) (209.85.214.45) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 May 2011 17:45:47 +0000 Received: by bwz16 with SMTP id 16so7208427bwz.32 for ; Tue, 24 May 2011 10:45:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.57.135 with SMTP id c7mr3367456bkh.88.1306259126455; Tue, 24 May 2011 10:45:26 -0700 (PDT) Received: by 10.204.78.15 with HTTP; Tue, 24 May 2011 10:45:26 -0700 (PDT) In-Reply-To: <4DDB6C3F.1030506@gmail.com> References: <4DDB6C3F.1030506@gmail.com> Date: Tue, 24 May 2011 14:45:26 -0300 Message-ID: Subject: Re: Constants From: Fernando Ribeiro To: dev@camel.apache.org Content-Type: multipart/alternative; boundary=001636d34c47378deb04a4092718 X-Virus-Checked: Checked by ClamAV on apache.org --001636d34c47378deb04a4092718 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It is about type safety more than anything else, meaning you can't possibly pass an invalid value. One could also say it is the "proper" implementation of enumerations in Java 5+, but I prefer the first argument. If we choose enums, we can split header and parameter names, for example, i= n types like Headers Params (e.g: FreemarkerHeaders and FreemarkerParams) instead of having to diff them in classes/interfaces w/ prefixes like HEADER_ and PARAM_ -- I like this. What do you guys think? On Tue, May 24, 2011 at 5:28 AM, Willem Jiang wrote= : > If we are using enums, what kind of benefit can we get compare to use cla= ss > or interface ? > > +1 to align this. > > Willem > > > On 5/24/11 1:08 AM, Fernando Ribeiro wrote: > >> Claus, anyone? >> >> On Tue, May 17, 2011 at 4:35 PM, Fernando Ribeiro< >> webmaster@fernandoribeiro.eti.br> wrote: >> >> Me neither, but agree we should align this, may also use enums, as JDK >>> 1.4 >>> was already dropped, what do you think, everybody? >>> >>> On Tue, May 17, 2011 at 4:30 PM, Christian M=FCller< >>> christian.mueller@gmail.com> wrote: >>> >>> We have classes and interfaces, e.g.: >>>> >>>> interface --> org.apache.camel.component.cxf.CxfConstants >>>> class --> org.apache.camel.component.jms.JmsConstants >>>> >>>> We should align this. At present, I don't have any preferences. >>>> >>>> Christian >>>> >>>> On Mon, May 16, 2011 at 11:20 PM, Fernando Ribeiro< >>>> webmaster@fernandoribeiro.eti.br> wrote: >>>> >>>> Any feedback yet? Thanks. >>>>> >>>>> On Fri, May 13, 2011 at 3:53 PM, Fernando Ribeiro< >>>>> webmaster@fernandoribeiro.eti.br> wrote: >>>>> >>>>> All, >>>>>> >>>>>> Is there any agreement here about whether we use interfaces, classes >>>>>> >>>>> or >>>> >>>>> enums for constants? If so, are there naming conventions that we use >>>>>> >>>>> or >>>> >>>>> would like to use going forward? >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Fernando >>>>>> >>>>>> >>>>> >>>> >>> >>> >> > > -- > Willem > ---------------------------------- > FuseSource > Web: http://www.fusesource.com > Blog: http://willemjiang.blogspot.com (English) > http://jnn.javaeye.com (Chinese) > Twitter: willemjiang > > Connect at CamelOne May 24-26 > The Open Source Integration Conference > http://camelone.com > --001636d34c47378deb04a4092718--