c# - How can I implement partial serialization? -


I have recently developed several serialization, to send objects to most sockets, but I have an interesting question:

My approximate scenario is this: You have some type of "state" object, each customer, which includes many properties (strings, intits, balls, etc.) When your customer first adds The whole state object is serialed through an XML or binary serializer, and is sent to the socket, which is rebuilt on the other side. Now both client and server are the same state object Your server needs to change the state again, and it is done only by establishing the property of a state object (either state events, or part of the state object itself) by resetting the entire population. Two states can synchronize, but it seems that there will be a "property change" object.

Obviously, this can be implemented manually, but it seems that the serializer should only serialize one property, and apply it on the other side like a patch. Does anyone know if this is possible, or will I have to write the whole thing with scratches?

with XmlSerializer (and Protocol-NET, for a binary equivalent , Because Protofuf-Net adopts the most of the XmlSerializer ) You can do this by making a method:

  Public Bold Soliselize () {Returns FUSD; } Public string foo {  

for each code) - But you will need to manually maintain "dirty" code ( Probably a lot of work in set ; I have done a different serializer in the past - it was a real potty, to be honest. I should also keep in mind that [XmlIgnore] public bool FooSpecified { Get} {{}} set {...}} pattern works the same, but whatever you want, ShouldSerialize * is more appropriate.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -