From: Davlet Panech (davlet_panech_at_[hidden])
Date: 2002-05-18 17:27:20
I have a few comments regarding the serialization
In the beginning of the "Reference" section there is a
paragraph that says:
"[...]oarchive/iarchive, constructs a portable text
archive. This can be read with on a different platform
by any program built with this same library[...]"
Later on the same page we find out that this library
"currently supports ascii text" and "unicode text".
I believe that portability requirements should be
specified in one place. When I was reading the
document the first statement about text archives being
portable between *all* platforms stroke me as highly
Also I believe there is more to portability of text
archives than support for a particular character set
(especially when it comes to wide characters). Two
"platforms" might very well support Unicode but use
different representation of characters.
Also I think the use of term "platform" is not
appropriate in the context it is used. I think what
you mean is not *platform*, but an "implementation of
ISO C++ requirements". A platform in the usual sense
(a combination of hardware and system software) might
support more than one implementation of C++, such that
certain details differ between implementations (e.g.,
sizes of types or alignment of objects).
Come to think of it, the issue of data transfers
between different implementations deserves more
consideration. The serialization library relies on an
external entity ("storage medium") for its correct
operation, therefore there should be a set of
requirements to the storage medium. For example,
consider the following program:
ifstream ifs( "filename" );
ifs.put( 'a' );
ofstream ofs( "filename" );
int x = ofs.get();
assert( x == 'a' );
Ignoring the error checking, is the last assertion
guaranteed to hold? The answer is obviously "no"
because the ISO C++ definition of a file is very
loose. The contents of the file could be changed by an
external process. Or it could be a UNIX FIFO that does
not produce the same data as it consumes.
Another problem is the representation of types on
different implementations. If sizeof(char) in program
"A" is different from sizeof(char) in program "B" what
happens when proram "A" tries to read a *text* archive
written by program "B"?
In all fairness we can't claim that text archives are
portable without specifying additional requirements
with respect to the above issues.
I'd like to point out that we will face similar issues
with any library that has to do with interprocess
communications, in particular the much-talked-about
networking library. IMHO it would be very desirable to
have these issues addressed w.r.t. the current ISO C++
execution, memory requirements and such.
Anyhow, going back to serialization:
- how exactly does one implement serialization not
based on streams?
- there are typos :)
- The "Overview" section contains the following set of
** Archive Operators **
** For Primitive Types **
** For Classes **
Headings that start with "For" in the middle of text
left me buffled there for a while. Perhaps you should
repeat the word "Operators" in each such phrase (e.g.,
"Operators for Classes" vs just "For Classes").
I'll try to read the design more carefully in the next
few days and might come back with more comments.
Find, Connect, Date! http://personals.yahoo.ca
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk