Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Efficient Communication via JSON and JavaScriptObject overlays in GWT 2.0

57 views
Skip to first unread message

maku

unread,
Jun 23, 2009, 1:42:01 AM6/23/09
to Google Web Toolkit
Hi,

I heard at a presentation of Google I/O 2009 (wave related) that they
used JSON data to communicate between client and server.

It was mentioned that in GWT 2.0 JavaScriptObject overlays will be
allowed to implement a single interface and that this mechanism is
used in context of JSON communication.

I would like to play around with such a communication mechanism.

Could anybody can explain details about this?

TIA
Martin

Thomas Broyer

unread,
Jun 23, 2009, 5:45:58 AM6/23/09
to Google Web Toolkit
I guess the upcoming "SingleJsoImpl" feature is rather useful for
testing: you can use POJOs implementing the interface for testing, and
JSOs in the app.

The other advantage is that the interface can be shared by your client
and server code and you have some "serialize to JSON" mechanism on the
server-side; so your code looks the same on the client and on the
server.

Note that you unfortunately cannot use a GWT generator to generate the
JSOs from the interface at compile-time (generators run after the JSOs
have been rewritten); but you could have one running in your IDE...

maku

unread,
Jun 23, 2009, 6:29:45 AM6/23/09
to Google Web Toolkit

On Jun 23, 11:45 am, Thomas Broyer <t.bro...@gmail.com> wrote:
> I guess the upcoming "SingleJsoImpl" feature is rather useful for
> testing: you can use POJOs implementing the interface for testing, and
> JSOs in the app.

> The other advantage is that the interface can be shared by your client
> and server code and you have some "serialize to JSON" mechanism on the
> server-side; so your code looks the same on the client and on the
> server.

From my point of view, I would like to be as lightweight as possible
on the client side especially on communication. In a current GWT
project we have tons of DTO's and Entities and so on which are
transported via RPC's and which blow up the size of the client code (I
guess...)

So I think about how this could be done better... (and maybe more
generic)

> Note that you unfortunately cannot use a GWT generator to generate the
> JSOs from the interface at compile-time (generators run after the JSOs
> have been rewritten); but you could have one running in your IDE...
We use already an own written code generator (based on
openarchitectureware / xtext) for generating many pieces of java code.
That could be another part for generation...

mjeffw

unread,
Aug 29, 2012, 10:54:27 AM8/29/12
to google-we...@googlegroups.com, Google Web Toolkit
Is this (see below) still true with GWT 2.0.5? I'm guessing it is based on my test of having a generator create a JSO -- it fails the compilation step. It would be great if this limitation could be overcome.
Reply all
Reply to author
Forward
0 new messages