[XML-SIG] Simple WDDX Serialization

Gabe Wachob gwachob@aimnet.com
Tue, 22 Dec 1998 17:37:36 -0800 (PST)


On Tue, 22 Dec 1998, Andrew M. Kuchling wrote:

> Gabe Wachob writes:
> >Tuples, Arrays -> WDDX Arrays
> >Objects -> Structs (obviously, skipping methods)
> >Number -> Numbers
> >String -> String
> 
> Dictionaries -> Structs would be another possibility. 

I think I mentioned that in another email.. If I didn't then oops. 

> >For the dateTime WDDX type, I am thinking either 1) do pattern matching on
> >strings to determine if they are valid time/dates -- if so, make them
> >dateTime WDDX elements, or 2) if a string begins with a magic code, then
> >the rest of the string is interpreted as a dateTime element. We could also
> 
> For dateTime, we would really need a standard date/time object,
> included in either the Python standard library or in the XML package.
> Instances of this object would then become dateTime elements in the
> generated WDDX.

Hey, I'm all for a dateTime object in the Python lib... However, isn't the
point of writing a WDDX serializer to make WDDX *transparent*? That is,
don't you want to eliminate special effort on the part of the Python
programmer in composing WDDX packets from Python entities? 

It seems unclean to have the WDDX serializer be transparent *except* for
the dateTime object -- perhaps this is WDDX's fault (dateTime seems to me
to be a higher level abstraction than String, Number, Array, etc). 

> For record sets, I haven't thought up anything yet, but I like your
> idea of a dictionary of keys mapping to equal-sized lists.

I see this an unavoidable kludge, actually. The problem is that the array
elements have to consist solely of "simple" types (according to the DTD).
That means that to "autodetect" that a dictionary should be mapped to a
recordset, we need to figure out the type of every element in every array
in the dictionary. Now, I suppose this may not be a big issue if we assume
that the data structures involved are not too complex or large (a valid
assumption given the type of applications likely to use WDDX, I would
think).

	-Gabe

-------------------------------------------------------------------
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