Remote Service synchronization

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Remote Service synchronization

Postby rueyfarn » Thu Sep 28, 2006 2:15 pm

GWT Designer is pretty good at creating the 3 related java classes for a given Remote Service. The remote service class, the remote serice async class and the remote service impl class.

It even goes so far as to if I add a new method in the remote service interface or change the method signature of any existing methods, it will automatically sync up the change with the remote service async interface.

Here is the issue that I am having some problem. The beta release is not doing anything to the remote service impl class in the server package. GWT Designer will just flag an error when I try to build or if automatic build is turned on, saying that the impl class does not implement the remote interface method(s).

It would be nice if it can generate some dummy code in the impl class just to satify the compiler.
Posts: 4
Joined: Wed Sep 27, 2006 12:13 pm
Location: New York

Postby Konstantin.Scheglov » Thu Sep 28, 2006 10:18 pm

I am not sure that we can do this in right way. Main problem (except that we should patch existing compilation unit and find correct places to insert new methods) is that we should do something with old methods. For example there was method in RemoteService interface "int foo(int a, int b)" and there was same method in Impl. Then you decided to remove second parameter ("b"). Designer should generate new method with different signature and remove old method. How can Designer know that some method existing in Impl is not just some helper method, but was previously in RemoteService and should be removed now?

BTW, do you know that Eclipse can generate stub methods for you? Place cursor on line of Impl declaration and press Ctrl+1 (quick fix). Eclipse will suggest generate all required method.
Posts: 186
Joined: Tue Oct 18, 2005 8:11 pm
Location: Russian Federation, Lipetsk

Postby Eric Clayberg » Sat Sep 30, 2006 7:05 pm

We decided to add new stub methods to Impl whenever a new method is added to the RemoteService interface. If the user changes the signature of a method, we add a new stub method to Impl.

It is then the user's responsibility to delete any unused methods in Impl. Our goal is simply to prevent compilation errors when the interface is changed.
Eric Clayberg
Software Engineering Manager

Author: "Eclipse Plug-ins"
Eric Clayberg
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 3 guests