One nice feature of the TDynArray
wrapper and its associated
methods, as defined and used in our framework, is the ability to serialize
any dynamic array as JSON content.
By default, only "standard" dynamic arrays (like
TIntegerDynArray
) are serialized as true JSON array: other not
known kind of arrays are serialized as binary content, within a Base64
encoding.
This is a very efficient solution for a pure Delphi application, since it will be fast and always works, but won't be easy to deal with from an AJAX client.
Applications can now supply a custom JSON serialization for any other
dynamic array, via the TTextWriter.RegisterCustomJSONSerializer()
class method.
Two callbacks are to be supplied for a dynamic array type information, in order
to handle proper serialization and un-serialization of the JSON array.