[XML-SIG] WDDX for Python

Simeon Simeonov simeons@allaire.com
Thu, 17 Dec 1998 18:52:36 -0500


Hi, Paul!

Many nice comments here.

>Okay, what if we just add an *optional* attribute called "type" to
>structs. People could ignore it if they want to but as a Python programmer
>I wouldn't feel like I was throwing away Really Important Information.

Yup, this is probably the easiest way to go about providing some basic
object serialization. I don't have a problem with this.

>Also, what if we added an optional "id" attribute and a <REFERENCE>
>type...(maybe I can wait on the reference type for WDDX 2, but I'd rather
>not)

This is a much nastier problem as it complicates and slows down both the
serialization and deserialization algorithms. Not that it's a difficult
thing to implement, but it does require the maintenance of data global to
the entire serialization/deserialization process and it slows the process
down considerably. We should probably handle this by optionally notifying
the serializer/deserializer that they are dealing with aggregate data and no
references.

>> I would disagree with you here... How can a Python app exchange data with
an
>> ecommerce app written in ColdFusion? Or a book browser that's written in
>> Perl? Or with Microsoft Word? How can it send a recordset and a three
>> dimensional array to a web browser where these data can be used to build
>> cool DHTML UI?
>
>If I had to send a 3D array of integers to Perl, I would send a bunch of
>lines like this:
>
>23 43 564 234
>40 203 03 203
>23 430 23 10
>
>It is presumably two lines of Perl code to split that up and convert it to
>integers. To me, the big win comes when I can send an OBJECT to Perl
>without dumbing it down into basic types. In fact, I think that the only
>features that I need to do this AS WELL AS the native Python tool called
>"pickle" is the "type" attribute and ID/IDREF. If I could just not throw
>away types then I could at least handle simple, non-recursive data
>structures okay (i.e. ID/IDREF can maybe wait).

Humor me and try to do the same using JavaScript or VBScript. Humor me even
further and exchange an array of arbitrary strings in a safe and efficient
manner. :) I think you'll find the problem unpleasantly fickle...

>> Bottom line: WDDX is not a solution for python-python object
serialization.
>> It can, however, open python apps up and let them communicate with a
_huge_
>> number of other applications.
>
>Sure, but we're so close to making it useful for Python->Python and (more
>interesting) Python->arbitrary OO language (including Perl 5) object
>exchange. I think that all we need is one attribute.
>
>The attribute should contain a URI (URIs are language independent) and
>each deserializer could have a mapping from URIs to class constructors.
>Languages that don't have a notion of class would ignore the URI. URIs are
>verbose but of course they compress beautifully.


I agree with you here. Do you have a particular URI type (look'n'feel) in
mind?

Sim