So we've got an app that needs to save and load its state from disk.
We've got the state in an object currently and that object is being serialized directly to XML with the XML serializer object. I've gone over this with the other developer on the project and he seems to think this is the perfect way to go about it. He asserts that having the model on disc being exactly like the representation in memory is ideal.
I feel that the way the data is saved to disk needs to be decoupled from its representation in memory so that we can modify one or the other without it being a breaking change for the saved format. Not to mention that the XML serializer requires everything needs to be read/write where in the object there may be many cases that need to be read only.
The question is there a best practice in regard to serializing in memory data to XML. Is it better to hydrate your object directly from the XML, or decouple the process by using an objects whose sole purpose is to be feed into the XML serializer?