views:

77

answers:

2

I am working on an application where client and server share an object model, and the object graphs can become rather big.

To save an object from client to server, ideally i would like to send only the difference over the wire, to minimize network traffic. I can pull the original object graph on the server and apply the delta to it

Wondering if there are any tools or projects out there or if anyone has had any experience with doing such a thing ..

many thanks

+1  A: 

You may be able to save some bandwidth by giving your objects the ability to calculate a hash of themselves based on their property values. Compare the server object hash to the client object hash, if they are different, update the appropriate one.

Matthew Vines
Similarly, you could use a timestamp or even a dirty flag.
Steven Sudit
+2  A: 

At a previous job, we had large 3-D models that we wanted to share between clients. To save actual model changes would have been impossible given model size and bandwidth restrictions.

Instead of sending the whole changed model, we opted to serialize operations on the data. For example, an operation might be {CUT plane: (pt1, pt2, pt3)}, or {DRILLHOLE (point, radius, depth)}. This worked great for our app, though it might not be appropriate for your model.

Also, Matthew's suggestion of calculating hashes or timestamps is a good one. Also, maybe you could keep a hashtable of unique keys so the server knows which ones were deleted and which were added.

Paul Williams