Overview

Navigation:  »No topics above this level«

Overview

Return to chapter overviewNext page

LMD NG-Serialization is a part of Next Generation (NG) package suite. All these packages are based on new IDE and language features of latest Delphi IDE versions.

 

NG-Serialization provides the ability to serialize/de-serialize Delphi objects into various storage formats. This allows to write data handling applications more easily and in more object oriented way. Common use cases of serialization engine are:

 

Saving/loading application options.

Sending business objects via net between client and server.

Saving/loading CAD-like application documents, since they are usually represented  at run-time as a tree-like object model.

ect.

 

In the current version the following formats are supported:

XML via Delphi standard XML access, e.g. IXmlDocument, IXmlNode.

JSON via Delphi standard JSON access, e.g. TJSONValue.

Binary stream via standard Delphi TStream.

XML via third party libraries (OmnyXML and NativeXML).

JSON via third party libraries (SuperObject).

Other formats, such as storing directly into Windows Registry, ect. are considered for next versions.

 

Serialization engine is based on the new Delphi RTTI feature. Basically, values of most of Delphi data types, such as numbers, strings, classes, records or arrays, can be serialized. Special attributes can be used to annotate types or fields/properties to specify or adjust various aspects of serialization process.

 

Features

 

Following is a short feature list of NG-Serialization package:

 

The ability of handling most of Delphi types. Engine does not favor to classes, any type, starting from primitive types, such as Integer or string, continuing to more complex types, such as records or arrays, can be serialized/de-serialized.

Support for serializing class/record fields or properties.

Full inheritance support.

The ability of adjusting serialization process using provided attributes, such as SerializableAttribute, TransientAttribute, AliasAttribute, ect.

The ability of writing custom converters.

Support of fill-read mode via FillReadAttribute. This mode allows to de-serialize owned by parent object sub-objects without re-creating them; that is, instead of usual action sequence, which is to create new sub-object instance, read its properties and assign this created instance to parent object's property, fill-read mode use the following action sequence: read parent object's property, and use read sub-object value to read its properties. This way parent object's property can be even read-only.