I have seen many bean classes like above which has private variables and getter/setter for encapsulation.
My question is that isin't this too much over engineering? Would it not be better to just have the class with the properties declared as public (assuming that the class has no behaviours/methods and the setter/getter do not perform any validation or any other operation on the data)
So that when getter/setter logic *does* change, so must all your code?
The issue isn't "over-engineering", it's Java's lack of real properties.
posted 10 years ago
I have never seen some of the DTO change (in one of the maintanance project ) and do not feel like that may change in future too, so in that case would it not be appropriate to choose data structure over OOP