We’ve got a huge data object structure, containing a lot of properties that are actually arrays. Now, we need to stream the data to an XML document.
For that, we thought to use the NativeXML component to stream. It uses the same mechanism that’s also used for TComponent streaming. This works fairly nicely, except that it doesn’t stream the indexed properties.
Is there a way to do this anyway, or are there components that are capable of doing this?
In the end, we resorted to creating a few extra classes (inheriting from
TPersistent) for the storage of the array properties; it turned out there was only a limited set of array types. Delphi’s indexed properties turned out to be really useful: we could just specify one getter function, and define most fixed elements of the array as separate properties referencing that one getter, and an index. Those properties now get serialized as proper XML elements, with the proper name as well.Adding constructors and destructors to all classes using them took a few tedious hours, though.
Anyway, thanks for all the suggestions!