Using the Briefcase Model

From InterBase

Go Up to Understanding Databases and Datasets


Most of this chapter has described creating and using a client dataset in a one-tiered application. The one-tiered model can be combined with a multi-tiered model to create what is called the briefcase model. In this model, a user starts a client application on one machine and connects over a network to an application server on a remote machine. The client requests data from the application server and sends updates to it. The updates are applied by the application server to a database that is presumably shared with other clients throughout an organization.

Note:
The briefcase model is sometimes called the disconnected model, or mobile computing.

Suppose, however, that your on-site company database contains valuable customer contact data that your sales representatives can use and update in the field. In this case, it would be useful if your sales reps could download some or all of the data from the company database, work with it on their laptops as they fly across the country, and even update records at existing or new customer sites. When the sales reps return on-site, they could upload their data changes to the company database for everyone to use. The ability to work with data offline and then apply updates online at a later date is known as the “briefcase” model.

By using the briefcase model, you can take advantage of the client dataset component’s ability to read and write data to flat files to create client applications that can be used both online with an application server, and off-line, as temporary one-tiered applications.

To implement the briefcase model, you must

  1. Create a multi-tiered server application as described in Creating multi-tiered applications in the Delphi Developer’s Guide.
  2. Create a flat-file database application as your client application. Add a connection component and set the RemoteServer property of your client datasets to specify this connection component. This allows them to talk to the application server created in step 1. For more information about connection components, see Connecting to the application server in the Delphi Developer’s Guide.
  3. In the client application, try on start-up to connect to the application server. If the connection fails, prompt the user for a file and read in the local copy of the data.
  4. In the client application, add code to apply updates to the application server. For more information on sending updates from a client application to an application server, see Updating records in the Delphi Developer’s Guide.

Advance To: