3 ms·
To answer a few sibling responses: The point is that mechanically maintaining get/set methods for each field is completely at odds with encapsulation. To conti
by geophile 2y ago
To answer a few sibling responses:
The point is that mechanically maintaining get/set methods for each field is completely at odds with encapsulation. To continue the example, sure, go ahead, have any or all of get/setX, get/setY, get/setR, get/setTheta if they make sense for your application. But writing them just because you've created a field, and the coding standards say they should be there is dumb. The coding standards that say this (like JavaBeans) may have their reasons, but OO ain't it.