[josm-dev] Difference between JOSM and JOSM-NG
Alexander Wright
silverfish at wright-family.me.uk
Tue Aug 12 07:55:44 BST 2008
On Monday 11 August 2008 23:41:09 Gervase Markham wrote:
> This and other considerations mean that any book you read on Java best
> practice (or any object-oriented language, for that matter) will
> recommend that you make your variables private and use accessor methods.
Ok, so I can't really comment, as I've no time to spend on JOSM code, but that
aside, I'd say that a very good reason to stick to OO best practise is one of
unit testing.
Not having accessor methods (with bounds checking for variables!) means that
its a lot more tricky to adequately unit test classes.
If I change a private variable, is the class still in a self consistent state?
If the answer is "I can't tell" then you really should be using accessor
methods.
Alex.
More information about the josm-dev
mailing list