commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: [Math] Issue 348
Date Fri, 05 Mar 2010 18:37:16 GMT
Hello.

> I don't see any changes proposed.

I propose to use the instance variable in place of the accessor.

> I see a couple of statements that getters are used (usually considered
> good), and a question about over-riding.

Getters are for accessing to encapsulated data. Within the class itself the
data is readily accessible, so using the accessor is, at best, less
efficient.
Moreover, if, by mistake, a sub-class overrides the accessor, you can get
inconsistent result: the overridden accessor can return some value while it
is another (the one stored in the instance variable) that is used to perform
the calculation.

Best,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message