com.smartgwt.client.docs
Interface ClientServerIntegration


public interface ClientServerIntegration

Client-Server Integration

Like client-server desktop applications, Smart GWT browser-based applications interact with remote data and services via background communication channels. Background requests retrieve chunks of data rather than new HTML pages, and update your visual components in place rather than rebuilding the entire user interface.

DataSources

First you must create DataSources that describe the objects from your object model that will be loaded or manipulated within your application. All of Smart GWT's most powerful functionality builds on the concept of a DataSource, and because of Smart GWT's databinding framework (see DataBoundComponent), it's as easy to create a DataSource that can configure an unlimited number of components as it is to configure a single component.

For background information on how to create DataSources, bind components to DataSources and initiate DSRequests, please see the Data Binding chapter of the Smart GWT Quickstart Guide.

Data Integration

DataSources provide a data-provider agnostic API to Smart GWT Visual Components that allow them to perform the 4 CRUD operations (Create, Retrieve, Update, Delete). By "agnostic" we mean that the implementation details - the nuts and bolts of how a given DataSource actually retrieves or updates data - are unknown to bound Smart GWT components. One effect of this is that DataSources are "pluggable": they can be replaced without affecting the User Interface.

When a visual component, or your own custom code, performs a CRUD operation on a DataSource, the DataSource creates a DSRequest (DataSource Request) representing the operation. "Data Integration" is the process of fulfilling that DSRequest by creating a corresponding DSResponse (DataSource Response), by using a variety of possible approaches to connect to the ultimate data provider.

There are two main approaches to integrating DataSources with your server technology:

The possible approaches are summarized in the diagram below. Paths 2, 3 and 4 are client-side integration approaches, and path 1 includes all server-side integration approaches.

Smart GWT supports, out of the box, codeless connectivity to various kinds of common data providers, including SQL and Hibernate. Smart GWT also provides functionality and tools for accelerated integration with broad categories of data providers, such as Java Object-based persistence mechanisms (JPA, EJB, Ibatis, in-house written systems), and REST and WSDL web services in XML or JSON formats. Ultimately, a DataSource can be connected to anything that is accessible via HTTP or HTTPS, and also to in-browser persistence engines such as Google Gears.

Choosing a Data Integration Approach

This section aims to help you decide which of the many possible data integration approaches is best for your particular circumstances. The recommendations given here will guide you to the approach that involves the least effort.


RPCs: Unstructured Server Communication

Smart GWT also supports "unstructured" client-server operations. These RPCRequests (Remote Procedure Call Requests) are a low-level, very flexible mechanism for custom client-server communications. In an nutshell, RPCRequests:

RPCRequests are relatively rare. Most client-server communications are better done in a structured fashion using a DSRequest (DataSource Request). Note that any RPCRequest can alternatively be framed as a DataSource fetch; depending on the circumstances, this may be more convenient.

See the RPCManager documentation for further information on RPCRequests.