Hacker News new | ask | show | jobs
by vips7L 442 days ago
Why would you use GSON for objects that go through steps of state? Why would you mark fields like State as final when it is actually mutable? This just sounds like poorly designed code.

Maybe I don't know of your use case, but GSON/Jackson/Json type classes are strictly data that should only represent the data coming over the wire. If you need to further manipulate that data it sounds like the classes have too much responsibility.

1 comments

all state is immutable :) a change creates new state - which is immutable
:) no its not.
if you change the state, it is not same state, it is a new state