Tutorial of Distributed Computing.
Project: JBuilder Tutorial
Author: Jens Ole Lauridsen
Company: Borland Int'l
Description: Tutorial of Distributed Computing using RMI and DataSetData.
This is an example of usage of the DataSetData class.
The example will also show how to write customized Providers and Resolvers.
Setup
- This example requires JBuilder 2.0.
- First start the RMI registry. Look for rmiregistry.exe in c:\JBuilder\java\bin
- Next run the DataServerApp in this project.
- Then run the ClientApp in this project.
What is going on
The DataServerApp is registering itself as a service for RMI.
It will respond to 2 inquiries: provideEmployeeData and resolveEmployeeChanges
as defined in EmployeeApi.java.
Both these methods are implemented in DataServerApp.java.
The ClientApp is simply a frame with a Grid, a Navigator, and a
TableDataSet. The dataSet has a custom Provider and a custom Resolver
attached. The Provider will get the data from the DataServerApp and
the Resolver will similarily use the DataServerApp to resolve the
changes back to the database. This is a multi tier solution.
What kind of metadata is passed by DataSetData.
The metadata passed in a DataSetData object is very limited.
Only the following Column properties are passed:
- ColumnName
- DataType
- Precision
- Scale
- Hidden
- RowId
If there are other column properties, that a server should pass to client
application, the server could pass an array of Column's via RMI. The Column
object itself is serializable. A client application could be designed to get
these column properties before it needed the data. The columns should be
added as persistent columns before the DataSetData is loaded.
How to modify the application to a 3 tier application.
- First modify the database connection in the DataServerApp.java to a remote
connection you got access to. Recompile.
- Run the rmiregistry and the DataServerApp from a different machine.
- Bring the ClientFrame.java into design view. Select the clientProvider1 and
clientResolver1 components and modify the hostname property on both components to
the hostname shown on the DataServerApp that is running on the other machine.
- Then run the rmiregistry and the ClientApp on this machine.
How do I get more information.