Entries in serialize (1)

Thursday
May262011

Serializing to Binary on WP7 - Part 2

After investigating a couple of 3rd party Binary Serialization libraries for WP7 and having seen a couple of suggestions online of just writing your own, I decided to do just that.

There were 2 main places where I found information on how to potentially write you own Binary Serializer for WP7, the first I felt took a rather old school approach by adding a "Write" function to each class which accepted a BinaryWriter and simply wrote out each of its own properties. The clear problem with this approach is the maintenance involved with adding new properties or if you wanted to serialize a different class.

The second approach was explained by Eugene Chaikin on his site, where he attempted to replicate the DataContractSerializer's interface and even make use of the '[DataMember]' attributes in the same way.

Click to read more ...