W3C home > Mailing lists > Public > xml-dist-app@w3.org > April 2000

Re: Fwd: LOPT: serialization algorithm suggestions

From: Ken MacLeod <ken@bitsko.slc.ut.us>
Date: 18 Apr 2000 08:20:23 -0500
To: xml-dist-app@w3.org
Message-ID: <x57ldv1r6w.fsf@bitsko.slc.ut.us>
"Eric Prud'hommeaux" <eric@w3.org> writes:

> I had imagined that the object serializing the data would be
> hard-coded to the structure, and that the generality of expression
> would payoff when a generic receiving agent was able to construct
> the data objects to pass to a handler. The handler would know that
> the memory image it was passed was actually a t_Bar and say:
> 
> LOTPResult LOTP_Bar_Handler (LOTPContext * c, int argc, void * argv[]) {
>     t_Bar * myBar = (t_Bar *)argv[0];
>     LOTPDeferred * reply = new LOTPDeferred("I'll get back to you.");
>     return reply;
> }

This is the crux of the problem.  Without some form of validation of
the XML input structure, your C code is going to dereference a pointer
and likely core dump if somebody passed you something you didn't
expect.  As soon as you add in the code necessary to do validation of
the XML input structure you have enough information to distinguish
pointers and nested data and the serialization format no longer needs
the extra complexity (attributes) to distinguish them.

  -- Ken
Received on Tuesday, 18 April 2000 09:16:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:58:56 GMT