On 12 nov, 17:48, Raziel <[email protected]> wrote:
> I know this depends on the details of what you're trying to achieve
> and the JSON object to be parsed (for example if it's dynamic
> orstatic, etc).
>
> I'm just wondering what are the principles that others follow to
> determine when to use one or the other.

I just do not ever use JSONParser, only JSOs (and with the JsonUtils
in GWT 2.0 you don't even need to do the eval() yourself). I sometimes
use the same JSO while the server sends me different JSON (with some
properties missing in some cases and not in others), I just write my
JSO to take this into account; for instance:

   public final native int getIntProp() /*-{
      return this.intProp !== null ? this.intProp : -1; // default
value; use this.intProp || 0 if the default value coerce to false
   }-*/;

And actually, now that I've switched to GWT 2.0, I use interfaces to
model my objects, with RemoteService/*Async interfaces to model my
services; and I implement them using JSOs (JSOs can implement
interfaces under certain conditions in GWT 2.0) and RequestBuilder
(everything's injected using GIN so other classes don't matter whether
they use real RPC or a RequestBuilder-based RESTful service request)

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=.


Reply via email to