[Zope3-dev] Object Serialization Brainstorm

Lennart Regebro lennart@regebro.nu
Fri, 21 Dec 2001 21:45:56 +0100


From: "Casey Duncan" <c.duncan@nlada.org>
> Actually you'd be surprised what you can do with introspection.

Well, if you with introspection can see the difference on different type of
data even though it's internal type is the same, then yes, I'd be surprised.
Introspection is what is used to do the XML export today, and it exports
file data as a base64 encoded string. There is no way for introspection to
see that some binary data should be exported as a file, and other as an
array of integers, for example.

> The problem with the export is that it is organized from the ZODB
> point of view, which isn't really that useful for anyting but packing
> and shipping data in and out of the ZODB.

But that is what you will arrive with if you only have introspection. If you
through only introspection can figure out what external applications would
like as a file format, then yes, again I would be surprised.
Perhaps the XML format from the export could be more "friendly", than it is
today, but that is a far cry from what you are suggesting.

> I think it can be done.

I still don't see how. What can be done though, is to have a standardized
interface for XML import/export that each class could without too much
trouble make it's own adapter for. This means that if you need XML
import/export for a class, it will be easy to do it.

But I don't think it can be done automatically in any way that is
particularily more useful than the XML export of today.