beautypg.com

Dynamic user interface generation, Java client and other three-tier systems – Apple WebObjects 5 User Manual

Page 81

background image

C H A P T E R 6

WebObjects Desktop Applications

Java Client and Other Three-Tier Systems

81

Apple Computer, Inc. January 2002

Although requested objects are copied from the server to the client, and these
objects exist in parallel object graphs on both server and client, the enterprise objects
on the client usually do not exactly mirror the enterprise objects on the server. The
objects on the client usually have a subset of the properties of the objects on the
server. You can partition your application’s enterprise objects so the objects that
exist on the client have a restricted set of data and behaviors. This ability allows you
to restrict sensitive data and business logic to the server. For example, in

Figure 6-7

,

the client side enterprise objects don’t have the “whole” property, the price the
seller paid to the manufacturer.

Once the client has fetched data, this data is cached and is represented internally by
the client’s object graph. As users modify the data (or delete or add “rows” of data),
the client application updates the client’s object graph to reflect the new state. When
the client application initiates a save, the changed objects are “pushed” to the server.
If the business logic on the server validates these changes, the changes are
committed to the database.

Note that Java Client automatically updates the client with changes that have
occurred on the server. Whenever the client makes a request, the server passes
updates along to the client with whatever information the client requested.
Similarly, Java Client has the opportunity to update the client before client-side
objects remotely invoke methods on server-side objects.

Dynamic User Interface Generation

Using the Direct to Java Client approach, the Swing user interface is generated
dynamically by the Rule System on the server. The Rule System analyzes an
applications’s data models (EOModel files) and generates XML descriptions of the
user interface. These XML descriptions are sent to the client where they are parsed
into Swing widgets to create the user interface.

Java Client and Other Three-Tier Systems

There are many distributed multi-tier Java-based architectures on the market today.
So how do they compare to WebObjects Java Client?