Reputation: 2149
I'm trying to find some general understanding of proper use of serialization for data transfer. Imagine we have two binaries. Each binary has some internal representation of data which fits its internal use model and the representation differs across binaries. Now we want to pass some data from one binary to other.
Two options:
Q:
Upvotes: 0
Views: 89
Reputation: 2985
The practical reality is that there is very little to differentiate the two approaches that you have suggested. But there are a number of important implementation trade-offs that you need to consider. Including:
Whether you serialize a class using say boost::serialization or google protocol buffers or whether you say write manual XML DOM code to read and write the data is a smaller detail of the more important considerations in your design. However, in my experience, if you have the flexibility to use a custom data format using serialization code is more maintainable, performs better and has fewer quality issues than home grown solutions.
Upvotes: 1