On Mon, Apr 6, 2009 at 11:30 PM, Mathias Herberts <[email protected]> wrote: > When I started Bibale (www.bibale.com) which is a GWT app, I was > looking at protobufs and Thrift for the backend. The lack of RPC > framework in the Open Source release of protobufs made me go with > Thrift in the end. > > Once Thrift was chosen, I looked at ways to extend it so both the > services and objects could easily be manipulated on the client (GWT) > side. I first came up with a solution which is described in > THRIFT-137, but the heavy use of java.lang.reflect lead to poor > performance, so I decided to give it a second shot and made new > changes to the compiler to generate better performing conversion > methods between *pure* Thrift objects and GWT compatible versions. > > My current modifications to the Java generator are the following: > > - a 'gwt' option that generates GWT compatible classes (not extending > TBase, not defining Metadata) located in a 'gwt' subpackage of the > namespace declared in the IDL file. > - a 'gwtready' option that generated standard Thrift classes which > also implement a GWTReady interface which has two methods, Thrift2GWT > and GWT2Thrift which convert between Thrift/GWT compatible instances. > This option also creates GWT compatible service interfaces (including > an async interface). > > Those two combined allow the use in GWT client code of objects which > mirror their Thrift counterpart. The services consumed by the GWT > client code take GWT compatible objects as parameters and calls can > simply be forwarded to a pure Thrift service with simple uses of > Thrift2GWT and GWT2Thrift. > > If anyone is interested please let me know, I'll put together a patch > and will create a New Feature issue in Jira. > > Mathias. >
Hi Mathias, I'm very interested by your approach, I'm working on the back-end side of a project involving Thrift and GWT, and I know the UI guys are having hard time about that. I'd definitively love to see what you came up to, it certainly may help them. Thanks for your help, Jeremie
