News for hackers. Stuff that matters.
Re:Data Classes for Java by mustardo on Thursday November 02, 2017 @03:27AM (#15608493)
For arguments sake you could say foo.bar = "baz" syntactic suggar for setBar("baz") sure you now cant add logic to the set method without introducing a real setBar method (and therefore breaking your public interface) but for immutable final DTO / POD style classes that don't have setters just use a public final field and be done with it

There's a difference between understanding encapsulation and being pragmatic

There are no comments on this comment yet.