Re: Fwd: LOPT: serialization algorithm suggestions

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