From dev-return-131425-apmail-commons-dev-archive=commons.apache.org@commons.apache.org Thu Dec 1 12:59:17 2011 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 5F1F27624 for ; Thu, 1 Dec 2011 12:59:17 +0000 (UTC) Received: (qmail 73663 invoked by uid 500); 1 Dec 2011 12:59:16 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 73569 invoked by uid 500); 1 Dec 2011 12:59:16 -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 73561 invoked by uid 99); 1 Dec 2011 12:59:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 12:59:16 +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 (nike.apache.org: domain of sebbaz@gmail.com designates 209.85.212.43 as permitted sender) Received: from [209.85.212.43] (HELO mail-vw0-f43.google.com) (209.85.212.43) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 12:59:09 +0000 Received: by vbbfq11 with SMTP id fq11so6301097vbb.30 for ; Thu, 01 Dec 2011 04:58:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=MasZ+FtIBxa42tmt5tcEszPXJC4hwszx+NW6vDiyfhU=; b=gFNYLR24mNEwUGwRtGpFye4uIe8hzMgFmvSB1d46kEOMhj5T0zsLn38ACmYS7i3ZFe 8mc0Ee81YA9PYUZpx+UxTRBDhIGzfisPOuVgFzahUOM7wGBzbgw9YJ7KSG1XedGwGMtO Apdd6juNQqjP7Ih27DTqxxuXxMUPe21u8jGeo= MIME-Version: 1.0 Received: by 10.52.90.171 with SMTP id bx11mr6051594vdb.26.1322744328512; Thu, 01 Dec 2011 04:58:48 -0800 (PST) Received: by 10.220.47.16 with HTTP; Thu, 1 Dec 2011 04:58:48 -0800 (PST) In-Reply-To: <1322743849566-4128191.post@n4.nabble.com> References: <1322743849566-4128191.post@n4.nabble.com> Date: Thu, 1 Dec 2011 12:58:48 +0000 Message-ID: Subject: Re: [JEXL] New non-private mutable fields From: sebb To: Commons Developers List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On 1 December 2011 12:50, henrib wrote: > Both 'parameters' =A0and 'cancelled' are protected so they can be used by > derived classes easily; having a private field + protected setter and get= ter > is clutter in this specific case. The problem with mutable non-private fields is that they are non-OO; they violate data encapsulation rules. They make it much harder to debug problems where the field is being updated incorrectly. Using getter/setter requires very little extra code, but brings big benefit= s. > Parameters holds the register 'names' which proves useful when debugging; > the 2 arrays are parallel. OK, so that needs to be documented. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org