Getters and setters may well be evil

Now first off I have to say I have a lot of time for Allen Holub. Ever since I got a review copy of his Taming Java Threads a few years ago, it has become my bible for threading in Java. Allen Holub’s article extends is evil made some very valid points – in fact I realised that I’ve subconsciously completely removed implementational inheritance from my code – the places in which the use of an extends relationship made sense seemed to occur less and less frequently.
Slightly less informative was his latest piece Why getters and setters are evil. I understand the logic and applaud him for raising this to peoples attention, but feel the rather abstract article could do with more in the way of concrete articles.
In anycase it seems that Allen is working on a new book, Patterns: Learning Design Patterns by Looking at Code, which I’ll be sure to pickup.

This entry was posted on Tuesday, September 9th, 2003 at 10:42 pm and is filed under Java. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

Be the first to comment.

Have your say





Fields in bold are required. Email addresses are never published or distributed.

Some HTML code is allowed:

URIs must be fully qualified (eg: http://www.domainname.com) and all tags must be properly closed.

Line breaks and paragraphs are automatically converted.

Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.