GWT RPC

From DesigningPatterns

Jump to: navigation, search

Background

GWT RPC is an RPC framework that allows communication between GWT client code (Javascript) and GWT server code (Java). In contrast to RMI, all GWT RPC calls are asynchronous. The caller provides a callback function object that is invoked by the framework when the server's response is received.

Advantages

  • GWT RPC allows seamless communication between the client (view + controller) and the server (model). From the perspective of the client, invoking the server is just another method call (albeit an asynchronous call).
  • The GWT RPC wire format is highly optimized. It essentially is a specialized form of JSON.
  • GWT RPC allows GWT classes to be serialized and passed back and forth between the client and server (including JDK collections).

Disadvantages

  • The GWT RPC wire format is *not* self-describing. In addition, it is opaque and may change wildly between GWT versions.
    • This means that the server, both in terms of GWT version and application data, always must be synch with the client.
Personal tools