Re:Why I Like The Verbosity of Java
by benjiweber on Wednesday January 04, 2012 @06:36PM
(#3426527)
There are alternatives. e.g. a public final Property<String> Name = new Property<String>();
Where Property defines a .get() and a .set();
However, getters and setters are generally a code smell. It's better to be telling objects to do things rather than ask them for information. Modern Serialization & Injection frameworks no longer require getters/setters.
Where Property defines a .get() and a .set();
However, getters and setters are generally a code smell. It's better to be telling objects to do things rather than ask them for information. Modern Serialization & Injection frameworks no longer require getters/setters.