List Info

Thread: Re: WD1.1, Ch 13, Limitations.




Re: WD1.1, Ch 13, Limitations.
country flaguser name
United States
2007-03-19 21:23:31

Given that JSON-RPC is based upon JSON which only can use JavaScript
literals, there isn't a way to represent references natively as a
JavaScript literal. Such a technique would need to rely upon some ID
or index into a greater storage mechanism. It isn't really consistent
with the intent of JSON.

If this was a great need however, you could essentially maintain an
object which served as a hashtable of objects each indexed by ID. Then
by passing a filter callback into the JSON deserialization method you
could resolve object instances as references to IDs into this table
structure.

It would purely exist as an application convention though as there
isn't a way to generalize it across platforms and applications.

--- In json-rpc%40yahoogroups.com">json-rpcyahoogroups.com, "Peter Farland&quot; <pfarland...> wrote:
&gt;
> Has any effort been made to either improve JSON to support references,
> or to define an extension to allow for references to preserve object
&gt; graphs (and, the special case, of a cyclic graph)?
>
> References allow for several optimizations too, such as avoiding
> sending redundant data.

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )