beautypg.com

Managing the user interface, Data synchronization between client and server – Apple WebObjects 5 User Manual

Page 79

background image

C H A P T E R 6

WebObjects Desktop Applications

Java Client Architecture

79

Apple Computer, Inc. January 2002

The client and server applications have duties other than merely providing the user
interface and database access—for example, each can contain business logic and
each communicates with the other through a Web server. However, the database
access/user interface division is significant because it provides a richness of user
interface without compromising security or performance.

Sensitive business logic and database connection logic is provided only by the
server application. Because compiled Java on the client side can be decompiled, the
client application is limited to user interface code and nonsensitive business logic.
At the same time, the ability to put some of the business logic on the client (any
nonsensitive logic) improves performance. By performing as much processing as
possible on the client (such as field validation), round trips to the server are limited.

To be clear, the Java Client architecture duplicates the graph of enterprise objects on
the client application so the graph and its management occur on both server and
client. WebObjects handles all client-server communication and distributes the
object graph across client and server.

Managing the User Interface

The user interface itself is implemented using Java Foundation Classes (JFC). This
is what gives a Java Client application the appearance and functionality of a
traditional desktop application. WebObjects maps data between the application’s
user interface and the graph of enterprise objects. Changes to the object graph are
automatically synchronized with the user interface and user-entered data is
automatically reflected in the object graph.

Data Synchronization Between Client and Server

Figure 6-7

(page 80) shows the flow of data between the client and server

applications for the Java Client architecture.

Starting in the upper left of the diagram and working down, when the client
application initiates a fetch, the client application forwards the corresponding fetch
specification to the server application. From there the normal mechanisms take over
and an SQL query is performed in the database server.