On Thu, Jul 15, 2010 at 5:31 PM, <[email protected]> wrote:

> It would be great if we could have one API that is shared by the client
> and the server, but the ideal client side library would permit the
> various subtypes to be nothing more than overlay types. I don't really
> like the current GWT JSON module, it was designed prior to overlay
> types.
>
> A overlay type version would be better, but you have to be careful about
> the fact that 'instanceof' won't work, you can use boolean checks, or
> you could add something more akin to the DOM Node.getNodeType() which
> returns an enumeration.
>

I always took the GWT JSON library as what you did when you had variable
JSON being returned and couldn't define the fields at compile-time.  If you
can use JSOs, you don't use this library at all, just have a static factory
method on the JSO to parse the JSON string.


> Could we perhaps extract some shared interface and make it shared, but
> leave the current implementation in c.g.g.dev.json (or in c.g.g.server?)
> That would allow a future c.g.g.user.json version to exist.
>

If you are using JSOs, why do you need anything more than a compatibility
wrapper (to fallback to eval) around JSON.parse than returns JSO?

-- 
John A. Tamplin
Software Engineer (GWT), Google

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to