I'm new to GWT and think it's great. Please keep in mind the below is
intended in a far more humble and grateful tone than I can represent
in English:
We're doing a pilot with GWT, hoping to create a "static" (client
only) application that uses an existing REST-like JSON service
implemented with Jersey.
The initial implementation uses RequestBuilder, eval, and a dumb overlay type.
JSONParser would be an alternative, producing JSONArray.
What I'd prefer instead is reuse of my existing (JAXB annotated) Java
class from the server side in GWT client code.
This is of course not an issue in the pilot project itself, but will
get uncomfortable in larger projects.
It also negates what we expected to be one of the main advantages of
implementing the web service and the client application in the same
language: code reuse.
Does any of the existing GWT JSON libraries support this?
This is the closest I have found, but it looks abandoned:
http://code.google.com/p/gwt-jsonizer/
Or is there a more server-side friendly alternative to
JavaScriptObject for overlay types? (JAXB and JPA frown upon the
protected constructor)
I guess not, so can we have one? :-)
I assume a lot of thought went into the current overlay type design,
but server side code reuse does not seem to have been a design goal,
and might require an alternative binding method.
Any advice appreciated:
Gabor Szokoli
Wow.
Looks impressive!
Thank you!
> I think it mostly does what you are looking for,
It does a lot more (I'd prefer to leave the server side to Jersey and
I'll make a RESTful service instead of RPC), but from what I
understand, your RemoteJsonServiceProxyGenerator seems to do what I
want.
Let me learn about GWT generators before I can comprehend it :-)
> but it doesn't pay any
> attention to JAXB annotations.
That's probably OK for me, my entities are quite simple, mapped
without extra annotations. I might have to add support for the
@XmlTransient later at most.
Sounds like a good general purpose project for bored GWT pros though:
"JSO generator from JAXB for JSON"
(Or am I trying to do something unreasonable here? I mean how come I'm
the first to complain about this?)
Gabor Szokoli
Ps: Generators... This new learning amazes me. Next thing we know GWT
will be employed to prevent earthquakes.
On Fri, Dec 12, 2008 at 9:08 PM, Shawn Pearce <s...@google.com> wrote:
> You might want to look at my still-under-development gwtjsonrpc:
>
> http://android.git.kernel.org/?p=tools/gwtjsonrpc.git;a=blob;f=README;hb=HEAD
> I think it mostly does what you are looking for,
It does a lot more (I'd prefer to leave the server side to Jersey and
I'll make a RESTful service instead of RPC), but from what I
understand, your RemoteJsonServiceProxyGenerator seems to do what I
want.
Let me learn about GWT generators before I can comprehend it :-)