In terms of immutability, you can consider installing interfaces on your domain objects:
In most places in your code, you want your objects to be immutable so that you can guarantee that they will not be changed - in this case you will work with a data access object that returns an interface, ensuring that your domain object cannot be changed.
If you write some kind of administrative page in which the user finishes editing the domain object, you will need to parse the setters - your data access object will have to return MutableDomainObject objects (either a class or a sub-interface).
Having said that, I agree with the YAGNI philosophy outlined above - if you do not need to guarantee invariability at the moment, at the moment you should not invest in it. It should not be too difficult to decompose interfaces at a later date.
source share