![]() Binary formats are more implementation-dependent and are not so standardized. Typical examples of text-based formats include raw text format, JavaScript Object Notation (JSON) and Extensible Markup Language (XML). Serialization archive formats can be divided into two main categories: text-based (stream of text characters) and binary format (stream of bytes). Archive medium is a name for file or stream. The good serialization support tools give possibility to choose the so-called archive type, i.e. Various object collections should be supported, including lists and dictionaries. The support of variants (unions in C), where the same memory buffer is used to store different objects.Ĭomplex structure, where single object could be referenced multiple times by various pointers and references, needs to be restored properly. Objects accessed by reference should be properly restored in terms of inheritance and multi-base inheritance. The portable serialization is not a straightforward process because:ĭifferent processor architectures (big-endian, little-endian) lead to a different binary representation of numbers and other objects, which potentially hinders portability. ![]() Serialization tools that allow this data exchange are referred to as portable. This functionality requires language-independent description of the data structure. The other reason for use of external tool to serialization is their support to exchange of information between modules developed in different programming languages or executed on systems with different architectures. This is the reason why libraries supporting serialization are provided. Manual creation of code to write and read object is time-consuming and liable to mistakes. Developers are required to rely on additional libraries or to manually write serialization code. However there is no support for more advanced constructions like pointers, references, variants, collections and objects. In particular, C++ standard library contains stream representation as well as conversions between a binary or text streams and built-in data types. In other programming languages, serialization is supported partially, and the usage needs some support in more advanced cases. In the optimal situation serialization (and deserialization), the object does not require any additional development and code. Many popular programming languages have serialization support included in the language core or in the standard library. Serialization is a low-level technique that violates encapsulation and breaks the opacity of an abstract data type. The object after serialization is called archive. The reconstructed object is a semantically identical clone to the original object. The object state could be reconstructed later in the opposite process, called deserialization or unmarshalling. ![]() The serialization changes the object state into series of bits. Serialization or marshaling is the process of converting object state into a format that can be transmitted or stored. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |