Article Preview
Buy Now
FEATURE
Binary Serialization
How to save and retrieve objects
Issue: 15.3 (May/June 2017)
Author: Sam Rowlands
Author Bio: Sam is a pixelMancer and codeWeaver at Ohanaware.
Article Description: No description available.
Article Length (in bytes): 22,751
Starting Page Number: 12
Article Number: 15302
Resource File(s):
project15302.zip Updated: 2017-04-30 19:21:55
Related Web Link(s):
http://www.xdevmag.com
Excerpt of article text...
In this edition, I'm going to cover a topic that comes up periodically and that's Serialization.
Serialization is a fancy term for converting an Object into data suitable for saving to a disk or transferring;
deserialization is the opposite process.The number one reason as to why I'd recommend serialization is complex data structures. Often when you start designing and building an app, the requirements are small and solved really easily, but as the project grows and the app becomes more complicated, so does the data structure.
I personally like to use a
dictionary
to organize the data. This allows for various data types to be stored in a single object, which in turn makes it easier to write out and read back in. Dictionaries can also grow and adapt as the needs alter.The advantage of using a binary format is
speed . Writing out and reading binary data is faster than any text-based format (JSON, XML, or plain text). Binary also has the advantage that byte data (such as pictures, colors, and other values) do not need to be encoded.Where to begin?
...End of Excerpt. Please purchase the magazine to read the full article.