Related to this I am looking into integrating better object handling
in gwtai and had a discussion
with Adrian about it.
We would like to hear what you guys had to say, though.
The fact:
We know that the arguments will be converted to string when calling a
method on the applet.
We have some control over the return value because the autogenerated
Javascript code
works like a Proxy between the applet and the Gwt code. But we have no
matching
proxy on the other side of the only-string-argument loophole that we
have.
My proposal:
1:
We define a json-based protocol for the only-string-argument loophole.
Basicly json-data with data and info about how to read the data.
2:
We create a proxy on the applet side - An applet the wraps the real
applet and calls the methods on it when requested. This proxy only
takes string arguments, but the jsondata in the string tells what
method to call and with which parameters.
What do you think?
- Michael
On 16 Dec. 2010, 06:46, Phaedrus <
routerde...@gmail.com> wrote:
> There are a few ways to do it
> 1) write toString() and parse() methods yourself to pass objects via the
> String callback (GWT built in JSONObject classes can be used to help)
> 2) Use a library.
http://code.google.com/p/google-gson/seems to be
> complete and automatic.
>
> Writing this functionality into gwtai seems to be beyond the project's
> scope.
>
> A nice overview is presented here:
http://stackoverflow.com/questions/683123/json-java-serialization-tha...
>
> <
http://stackoverflow.com/questions/683123/json-java-serialization-tha...>The
> discussion mentions a few other libraries that keep things clean with
> interfaces and annotations, but in the end the serialization is manual (with
> helpers).
>
> HTH
>
>
>
>
>
>
>
> On Wed, Dec 15, 2010 at 10:50 PM, Phaedrus <
routerde...@gmail.com> wrote:
> > I agree that the direct call / JSObject method is what is needed for
> > simplicity & speed in this case. I too considered local RPC, but i think
> > it's overkill for something that can be more directly connected.
>
> > I have a feeling I'm going to end up writing the JSON String approach, so
> > I'll keep you updated and for sure I'll be happy to clean up & contribute
> > what I come up with.
>
> > Regarding my one question about having an option for a blank codebase (not
> > specified at all), am I missing something or is it actually impossible at
> > the moment? Currently it seems like if codebase is not specified, it uses
> > the object path, which i don't think will work for everyone.
>
> > Thanks,
>
> > ~Phaedrus
>
> >>
gwtai+un...@googlegroups.com <
gwtai%2Bunsu...@googlegroups.com>
> >> .