jeudi 13 août 2015

Maintain original DTO values along with new ones - design pattern?

I have a need in my WPF application to keep original values of properties, as well as the editted/updated values, of my Data Models.

Long story short, we've wrapped our web service which completely uses DataSets with a repository that gives us simple DTO's. We've found that the web service sometimes checks the DataRowState, and we need to maintain the state of an object, and the original value of properties on that object.

My google searches were poor, likely from a lack of decent terminology. Is there a known, effective implementation for keeping track of original values of an object, as well as new values (aside from simply keeping two copies of the model)?

Ideally we'd want to hide this complexity as much as possible from the layers above the repository and the mapping DataSets to objects.

Thanks for any pointers and guidance.

Aucun commentaire:

Enregistrer un commentaire