Re:Java 9 features announced
by Consultant32452 on Tuesday August 19, 2014 @10:31AM
(#8197461)
In Java culture immutable generally means private final member with only a getter and no setter. I would argue that this is good OO design as the purpose of OO design is to protect your interface from future design changes. If you need to change your accessor, you already have one. If the member needs to be mutable at a later date you need only remove the final keyword and potentially add a setter. The interface remains backwards compatible.
[ Parent
| on HN ]
Re:Java 9 features announced
by patrickmay on Tuesday August 19, 2014 @11:08AM
(#8197693)
I disagree. If you require an accessor to actual internal state, you should rethink your dependencies and reassign some behaviors. Accessors should be rare, mutators almost non-existent.