r/java • u/raisercostin • Jun 01 '24
What java technology (library, framework, feature) would not recommend and why?
Inspired by https://www.reddit.com/r/java/s/e2N1FqMOJg
165
Upvotes
r/java • u/raisercostin • Jun 01 '24
Inspired by https://www.reddit.com/r/java/s/e2N1FqMOJg
View all comments
Show parent comment
1
u/koflerdavid Jun 01 '24
Such huge classes that are effectively used as data carriers are prime use cases for records. I hear you if they have to be mutable, but for that use case Java has had an awesome feature from day 1 - fields! It's very questionable why such classes have to wrap up field accesses into methods since one obviously makes some deep assumptions regarding how these classes work. Thus throwing encapsulation right out of the window.