We're making an app that visualizes data in a number of ways.  Data sets can be 
uploaded to and downloaded from the server, as well as merged, subtracted, etc. 
 All the data manipulation happens on the client; the client should be able to 
store users' data sets on the server after they've been manipulated locally.  
In the past, we just serialized the client-side data set as JSON and sent it to 
the server for storage. 

In the previous version of our app, we used raw Javascript (and jQuery) on the 
client.  We hit a complexity threshold where new features were taking too much 
time, and decided to port to GWT.  In general, our productivity has improved a 
lot (we're old Java hands, and Java offers more language features for managing 
complexity than JS), but this is the last big missing piece.

Another thing I should mention is that we're using Google App Engine as the 
backend, so we can't use GWT's built-in RPC services.  (If we were starting 
from scratch, we would consider them seriously.)  Using GAE has other 
implications.  Due to GAE's fairly tight CPU quotas, we are more or less 
required to do the data set manipulation on the client.  If we had more 
server-side resources, we might be able do all the data set manipulation on the 
server and have the client retrieve read-only copies serialized as JSON for 
display.

Thanks for your interest.
________________________________________
From: Google-Web-Toolkit@googlegroups.com [google-web-tool...@googlegroups.com] 
On Behalf Of mikedshaf...@gmail.com [mikedshaf...@gmail.com]
Sent: Wednesday, December 17, 2008 8:15 AM
To: Google Web Toolkit
Subject: Re: Client-side JSON Serialization?

I haven't done anything non-trivial in JSON & GWT, but what are you
looking to do that you can't do natively with GWT?  Like on these
examples:

http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=GettingStartedJSON

I'm trying to figure out your use case and what you can't do with GWT
that you'd need json2.js or something like it.  Just wondering most of
all.

Later,

Shaffer


On Dec 16, 11:24 pm, Shawn Pearce <s...@google.com> wrote:
> Roll your own, or look at gwtjsonrpc:
>
> http://android.git.kernel.org/?p=tools/gwtjsonrpc.git;a=blob;f=README...
>
> You can also look at JSNI and the JavaScriptObject subclassing tricks in the
> GWT documentation (under JavaScript Integration) to build Java objects that
> are more directly JavaScript entities, and thus more easily serialized with
> JavaScript JSON libraries.
>
> On Tue, Dec 16, 2008 at 18:34, clint.gilb...@childrens.harvard.edu <
>
> clint.gilb...@childrens.harvard.edu> wrote:
>
> > I'm sorry if this has already been answered, but after searching a bit
> > I didn't come up with any answers.  Does anyone know of a way to
> > serialize objects to JSON on the client side?  Ideally, it would work
> > similarly to the json2.js lib from json.org that I was using prior to
> > moving to the GWT, but anything relatively straightforward that
> > performs well is fine with me.
>
> > I tried wrapping the json2.js lib in a native method that calls
> > $wnd.JSON.stringify():
>
> > public abstract class JSONSerializer
> > {
> >    public static final native String serialize(final Object object)/*-
> > {
> >        return $wnd.JSON.stringify(object);
> >    }-*/;
> > }
>
> > but it pins my CPU and runs for several minutes when serializing
> > anything but a trivial object.  The problem seemed to be the verbosity
> > (completeness?) of the object when marshalled across the Java-
> > toJavascript boundary by the GWT.  I'd also like to control the
> > mapping of Java properties to JSON ones.
>
> > Surely there's a better way?  Or will I have to roll my own?




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

Reply via email to