commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [JEXL] New non-private mutable fields
Date Thu, 01 Dec 2011 12:58:48 GMT
On 1 December 2011 12:50, henrib <henrib@apache.org> wrote:
> Both 'parameters'  and 'cancelled' are protected so they can be used by
> derived classes easily; having a private field + protected setter and getter
> 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 benefits.

> 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


Mime
View raw message