Note that there are some explanatory texts on larger screens.

plurals
  1. POEasy to use extensible serialization/marshalling?
    text
    copied!<p>I have a question about <strong>serializaton</strong> of data structures. There are a many possibilies for serialization of data structures (also called <strong>marshalling</strong> or <strong>deflating</strong>, see <a href="http://en.wikipedia.org/wiki/Serialization" rel="nofollow">wiki-article</a>). Every programming language, framework, standard or library seems to bring their own methods of serialization with it. Many also define their own data/interface description language (which i prefer to language dependend data structure defined only inside the code). Just to name a few (see <a href="http://en.wikipedia.org/wiki/Comparison_of_data_serialization_formats" rel="nofollow">wiki-article</a>): COM IDL, CORBA IDL, Thrift IDL, google protocol buffer ".proto", XSD, ASN.1 IDL, and so on. Some of these serialzations are able generate language native data structure and code for serialize and deserialize these structures.</p> <p>I did some research on this subject, but i am still undecided. So my question is: <strong>Which serialization should i use?</strong> </p> <p><strong>My requirements</strong>: <strong>extensibility</strong>, space efficiency (at least binary), efficient access to data, ease to use (possibly with generated code and getter and setters) and c++-compability. </p> <p><strong>The extensibility should provide forward- and backward compability</strong>. To be more specific, often the data formats i write will grow over the time, because i add new data fields, which i couldn't foresee at the beginning of the development. Now i would like to be able to read stored data from an outdated format with a newer software version, the data fields not found in the old stored data could be filled with default values or something. On the other side i would like to be able to read data written with the new desription. The unknown data field should be then ignored by software compiled with the "old" data description (maybe generating some warning).</p> <p><strong>Any recommondations?</strong> Recommondations on further readings on that subject would be appreciated too.</p> <p><strong>--- Edit ---</strong></p> <p>1) boost::serialization seems to be quite popular. It has some really nice features, the documentation is very good, ant the syntax seems to be quite straight forward. Maybe i am a bit picky, but there are some things i dislike: I don't see how it could handle forward compability (see <a href="http://en.wikipedia.org/wiki/Forward_compatibility" rel="nofollow">4</a>). I would prefer generated code.</p> <p>2) google protobuf seem to fit my needs better, but i haven't looked into the depth of them. They seem to handle forward and backward compability well (see <a href="http://code.google.com/apis/protocolbuffers/docs/cpptutorial.html" rel="nofollow">5</a>). They have code generators for different languages, and the developers are aware of very similar concepts like (see <a href="http://code.google.com/apis/protocolbuffers/docs/faq.html" rel="nofollow">FAQ</a>). I will have a deeper look into protobufs.</p> <p>3) boost spirit does not seem to be the thing i search.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload