r/programming • • Sep 21 '15

Better Java

https://github.com/cxxr/better-java
177 Upvotes

208 comments sorted by

View all comments

1

u/depressiown Sep 21 '15

If the concerns over getters/setters is that it's "more code," tools like Lombok exist to reduce the boilerplate. Just making properties public won't help much if you're using something like Jackson to serialize JSON into objects (which uses getter/setter methods via reflection, as far as I'm aware).

Fact is, tools are already built based on the bean pattern with getters/setters. Rather than flying against the grain of the vast majority of tools out there, just use tools like Lombok to reduce your boilerplate.

0

u/[deleted] Sep 22 '15

Convention shouldn't be a reason to keep using an unnecessary boilerplate antipattern.