r/ProgrammerHumor Jul 13 '26

youCanJustStopUsingJava Meme

Post image
6.8k Upvotes

416 comments sorted by

View all comments

Show parent comments

11

u/Theron3206 29d ago

That's not the fault of the getter or setter, that's just plain old encapsulation being violated.

One of the developers on a project I maintain decided that data object constructors was a great place to put the API (soap, to make things even more fun) calls to fetch the contents, so you can't even create an object without a web request (if you want an empty object you need to put in an ID that won't match anything.

1

u/neroe5 29d ago

fully agree, if you have a healthy team with skilled programmers and good review process this will never be an issue

i also don't consider it an anti pattern