Request for pre-review: std.serialization/orange

Robert Jacques sandford at jhu.edu
Fri Sep 30 21:29:13 PDT 2011


On Thu, 29 Sep 2011 14:58:30 -0400, Jacob Carlborg <doob at me.com> wrote:

> I would like to have some form of pre-review of my serialization library
> Orange for later inclusion in Phobos as std.serialization (or similar).

[snip]

(1)
The first example in class Serializer is:

auto serializer = new Serializer;

Shouldn't it be

auto serializer = new Serializer(archive);

(2)
orange.serialization.archives.XmlArchive need to be documented.

(3)
if Archive.Array (which is poorly named btw) "is a type independent representation of an array" then why does it contain an elementSize field?
(3a)
Also by the time archiving is called, isSliceOf should always return false. That this function exists speaks to design problems both large and small. On the small scale, isSliceOf indicates that you are testing every array against every other array for slicing, which I hope is not the case. On the large scale, all the alias/object/pointer/arrays/etc resolutions should be done by the serializer not the archive. The archive should only be responsible for converting the internal representation of the serializer to JSON/XML/YAML/etc.
(3b)
Given that Slice has an ID field, why doesn't array.

(4)
Why have an Archive Interface and a Base class with common functionality? Why not an abstract class? Also, 'Base' isn't an acceptable class name for a Phobos module. Use 'ArchiveBase' or something more unique instead.


More information about the Digitalmars-d mailing list