I would like to be able to update objects by serializing/deserializing only the field that changed.
I am using the nongeneric version of the serializer since I don't know the type at compile. At runtime, I do have the type though.

Second option would be to create the model on the fly, and only tell it about the members that are changed. However, since by default this would cause (over time) lots of dynamic code to be generated, so you might want to set AutoCompile to fse for that case.

A third option would be to serialize manually via ProtoWriter. This probably needs more protobuf know-how than is desirable.

Thanks Marc. The ShouldSerialize pattern would be useful. Say I could get it to serialize partially though. How do I deserialize? Here is the problem I am having. I serialize an object with default values except for a single field which I set. Later I want to reset the object to the default remotely by sending it the new serialized empty object. The updated object is very small since no fields are set. Merging this into the original has no effect. My intension is to set the field to zero. So really, I want to deserialize into an existing object, but clearing the existing fields first.
–
JohanJun 6 '11 at 11:29

@Johan - not entirely following. If you mean "how do I load the changes into an existing object", that is what Merge is for - or, in v2 - just pass that object into Deserialize.
–
Marc Gravell♦Jun 6 '11 at 12:17