One of the really nice parts about GWT is their GWT RPC (Remote Procedure Call) interface. It functions similar to RMI in Java, where you define methods on an interface, and just extend the RemoteService interface. For example:
public interface SampleInterface extends RemoteService
{
public void myMethod();
}
You end up requiring an Async interface as well, that takes a callback as one of the parameters, but the GWT plugin for Eclipse will actually generate that for you, and prompt for changes to methods in one or the other if the method signature changes.
So, you get all of your handler code in a method, that's able to be called directly, without invoking any lengthy servlet strings directly. It's extremely nice.
For more information and examples, you can check out https://developers.google.com/web-toolkit/tools/gwtdesigner/wizards/gwt/remoteservice
No comments:
Post a Comment