lundi 16 mars 2015

Are there design patterns for the design and implementation of file formats?

From time to time, either at work or while hobbying, there comes the need to implement a file format, that is, taking some lengthy document, and to figure out how to implement its data structure / object model, as well as reading and writing operations, on a given language.


Today my company decided to ditch a rather convoluted file format - although a de facto standard - in favor of a spin-off developed in-house (I must admit I was the first to suggest it).


So, my question is: are there any documented design patterns, or otherwise "good practices" to be used when specifying and/or implementing file formats?


Some recurrent problems that could originate these patterns are string encoding, numeric array encoding, choice for field/record/group separators, header design, hierarchical and recursive data definitions, choice of magic numbers, techniques for strided reading, etc.


Ideally, I would like a book or book chapter, but I appreciate any useful reference on the topic.


Aucun commentaire:

Enregistrer un commentaire