|
Boost : |
From: Jeremy Maitin-Shepard (jbms_at_[hidden])
Date: 2002-12-16 00:27:42
On Sat, Dec 14, 2002 at 10:18:32AM -0800, Robert Ramey wrote:
[snip]
> topic. It seems that there is a strong belief that there can be created a
> generic system which will map an arbitrary set of C++ objects in a meaningful
> way to another other format. Such a system will necessarily have to start
> with a system of reflection that describes all aspects of data structures
> that the system aspires to support. For example, if XML is to be supported,
> items will have to have external names. Once this system of reflection (or meta-data)
> were specified, then importers/exporters to from/to each file format would be
> created. There is at least one commercial product that does this (Data Junction)
> This is a hugely ambitious undertaking that is only tenously related to serialization.
Yes, I agree. We should begin discussion of a reflection library. I
will give the following suggestings regarding such a system:
I think such a system should be based on providing an interface for
accessing and assigning the value of any exposed field. I believe the
following types are sufficient for representing anything that could be
serialized:
- built-in numeric types
- fixed-length containers of a single type
- variable length containers of a single type
- container with a single value of variable type
- character strings (note: these are included separate from variable
length containers of a single type only because it is extremely common
to handle them separately)
- pointer or reference to a type
- aggregate of zero or more of the above types
In order to facilitate serialization/persistence, a name for each
field as well as version history (i.e. the version in which it was
added, and possibly a version in which it is removed). The same could
be specified for base classes.
I realize this is not much to go on, but please provide comments.
- Jeremy Maitin-Shepard
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk