[XML-SIG] WDDX for Python

Jeremy Allaire jeremy@allaire.com
Thu, 17 Dec 1998 16:31:19 -0500


>Well, I wonder aloud whether its possible (or worth attempting) to write a
>serializer for arbitrary python objects. What is the approach taken in
>other languages? I have not looked at much WDDX stuff besides the DTD..
>(in fact, the first time I had ever looked at the WDDX stuff for more than
>a minute was when I sat down to write the Deserializer).
>
>Also, I'm not sure what sort of Python objects or data types would map to
>a timeDate WDDX element.
>
>I'm thinking that the best thing to do would be to create a WDDXCreator
>object that would work on WDDXObjects (ie WDDXStruct, WDDXdateTime, etc).
>
>I don't know -- looking at how other languages like Java do it would be
>instructional..


You should look at the Perl and COM implementations -- they're part of the
downloadable SDK, including references and examples.

>I actually have no immediate use for WDDX, nor any past experience in it.
>I've recently been getting into XML using Python and your message to
>XML-SIG (the Python XML SIG list) was timed perfectly for a "Gee, that
>looks like a cool thing to play around with" project... Turns out that
>Python is such a cool language that it only took an hour or so to write...


That's awesome that it was so easy to put together.  I think the serializer
side is dooable without a lot of work.  That would then let Python be a
'object server' to any other scripting language on the Web, as opposed to
the deserializer which would allow Python to be a 'client' to other
distributed web applications.

WDDX is useful for a lot of things.  For one, it allows you to tie together
applications created with different applications.  It also allows you to
expose your Python apps as 'services' that can be leveraged over the net by
any other web application, creating what we're calling 'web syndicate
networks'.  It's even useful for doing rich DHTML/JavaScript front-ends with
Python back-ends, as with WDDX you can pass live objects from your server to
the browser and have them load automagically as JavaScript objects in the
page.  There's some good examples in the SDK of this behavior.

Regards,
Jeremy




>
> -Gabe
>
>>
>> Thanks and regards,
>> Jeremy
>>
>> -----Original Message-----
>> From: Gabe Wachob <gwachob@aimnet.com>
>> To: Jeremy Allaire <jeremy@allaire.com>
>> Cc: 'xml-sig@python.org' <xml-sig@python.org>; Simeon Simeonov
>> <simeons@allaire.com>
>> Date: Tuesday, December 15, 1998 7:15 PM
>> Subject: Re: [XML-SIG] WDDX for Python
>>
>>
>> >Hi folks-
>> > In response to this request, I put together a Deserializer (there
>> >are some issues in serializing that I didn't want to address yet) for
WDDX
>> >data into a python object.
>> >
>> > One question I had is this:
>> >
>> >In the DTD, you show that a data element can contain one or more of any
of
>> >the data types plus recordset/struct/array. Does this mean that this is
a
>> >valid XML fragment:
>> >
>> ><data>
>> ><number>43</number>
>> ><struct>
>> >...
>> ></struct>
>> ></data>
>> >
>> >I made the assumption that is was, so in my deserialization, I create an
>> >object WDDXObject which contains an array items -- in the previous case
>> >the array would contain a number as its first element, and the struct
>> >object (WDDXStruct) as its second element.
>> >
>> >If data has more than one child, then how do you refer to each child if
>> >you don't implement the deserialization the way I do with an array as
the
>> >"top level" child of the deserialized object (I ask because I didn't
want
>> >to do it this way, but I couldn't think of another simple way of doing
>> >it). What if you have two structs with two element variables with the
same
>> >name?
>> >
>> >So, anyway, my deserializer fully implements the DTD and the spec as far
>> >as I understand it. It does not parse the timeDate type (I could throw
it
>> >in a wrapper object with nice methods and all).
>> >
>> >The URL is http://www.aimnet.com/~gwachob/software.html
>> >
>> >It uses my current rev of my DOMVisitor.py  Everything is not well
tested,
>> >and in fact, may not be the most efficient. However, here it is...
>> >
>> > -Gabe
>> >
>> >On Sun, 13 Dec 1998, Jeremy Allaire wrote:
>> >
>> >> Hello folks-
>> >>
>> >> I'm interesting in engaging anyone/everyone from the Python community
to
>> >> work with us on a WDDX platform module for Python.  With the help of a
>> few
>> >> developers, we've been able to muster/ship WDDX modules for ASP/COM,
>> Java,
>> >> ColdFusion, Perl and JavaScript, and would love to see a Python
>> >> implementation.
>> >>
>> >> Given the recent XML release for Python, seems like it would be a
great
>> >> project to make cross-language distributed web applications even more
>> >> possible.
>> >>
>> >> Take a visit to www.WDDX.org, and most importantly take a view of the
>> SDK,
>> >> developed by Nate Weiss, which brings it all together with all of the
>> above
>> >> languages.
>> >>
>> >> Best and regards,
>> >> Jeremy Allaire
>> >>
>> >> _______________________________________________
>> >> XML-SIG maillist  -  XML-SIG@python.org
>> >> http://www.python.org/mailman/listinfo/xml-sig
>> >>
>> >
>> >-------------------------------------------------------------------
>> >http://www.aimnet.com/~gwachob               http://www.findlaw.com
>> >"A popular Government, without popular information, or the means of
>> >acquiring it, is but a Prologue to a Farce or a Tragedy; or perhaps
>> >both." -- James Madison
>> >                       import std.disclaimer
>> >
>> >
>>
>>
>> _______________________________________________
>> XML-SIG maillist  -  XML-SIG@python.org
>> http://www.python.org/mailman/listinfo/xml-sig
>>
>
>-------------------------------------------------------------------
>http://www.aimnet.com/~gwachob               http://www.findlaw.com
>"A popular Government, without popular information, or the means of
>acquiring it, is but a Prologue to a Farce or a Tragedy; or perhaps
>both." -- James Madison
>                       import std.disclaimer
>
>