I have a question about serializaton data structure. There are many possibilities for serializing data structures (also called sorting or deflation , see the wiki-article ). Every programming language, structure, standard, or library seems to bring its own serialization methods with it. Many also define their own data / interface description language (which I prefer the dependency structure to be language dependent, defined only inside the code). Just to name a few (see wiki article ): COM IDL, CORBA IDL, Thrift IDL, Google.proto protocol buffer, XSD, ASL.1 IDL, etc. Some of these production series can generate their own language data structures and code for serializing and deserializing these structures.
I did some research on this, but I still haven't decided. So my question is: What serialization should I use?
My requirements are extensibility , space efficiency (at least binary), efficient data access, ease of use (possibly generated code, getter and seters) and C ++ -compability.
Extensibility must provide backward and forward compatibility . To be more specific, often the data formats that I write will grow over time because I add new data fields that I could not foresee at the beginning of development. Now I would like to be able to read saved data from an obsolete format with a newer version of the software, data fields not found in the old saved data can be filled with default values or something else. On the other hand, I would like to be able to read data written with a new description. Then, an unknown data field should be ignored by software compiled using the "old" data description (possibly generating some warning).
Any recommendations? Recommendations for further readings on this subject will also be evaluated.
--- Edit ---
1) boost :: serialization seems pretty popular. It has some really nice features, the documentation is very good, the ant syntax seems pretty straightforward. Maybe I’m a bit picky, but there are some things that I don’t like: I don’t see how this could handle advanced compilation (see 4 ). I would prefer the generated code.
2) goob protobuf seems to best suit my needs, but I did not look into their depths. They seem to cope well with forward and backward compatibility (see 5 ). They have code generators for different languages, and developers know very similar concepts like (see FAQ ). I will study the protobuffs more deeply.
3) Strengthening the spirit is not like what I'm looking for.