Sunday, 2 November 2014

How tolerant is XmlSerializer of change



I am developing a mobile cross platform game (iOS, Android, WP8) using MonoGame & Xamarin. I have a class called PlayerData that holds data such as high score and other stats. I write and read it using XmlSerializer. After releasing the game, assume I change the base class of PlayerData, add new fields, and remove some existing ones then I release it again as an update. Will XmlSerializer be able to successfully read the the saved XML data of the previous version which doesn't map exactly to the updated PlayerData class? under which conditions would it fail? Do you advise any better alternative for future projects?


No comments:

Post a Comment