Practical Client/Server Without the Server!
By Al Williams
Last month we looked at how to write custom servers in Java that can handle specialized tasks on behalf of a Java applet. The example program, a tic-tac-toe game, used a custom server to connect applets on different machines.
This works well for applets, but sometimes an applet isn't the best answer to a problem. In client/server programming today, it's clear that the Web browser is the ultimate client. Not only does everyone have a Web browser these days, but big companies like Microsoft are pouring tremendous sums of money into their development. It's unlikely that on my budget I'm going to come up with a piece of client software to rival Microsoft's or Netscape's.
Consider a very simple case. Suppose your sales force wants to enter orders on a personal computer for input into an order-entry system on a mainframe. Of course, there are various ways to do this, but to keep things simple, further suppose that you wanted to save the input to some comma-delimited files on the server. Perhaps the mainframe will read them as a batch.
This isn't very hard. You could do it with Perl, of course, or any CGI-scripting language. Active Server Pages would work and so would Java servlets. However, all of these methods presuppose one thing: that you can connect to a server to use. In other words, as long as the salespeople are in the office (and the network is up), no problem. But what happens if they're in the field and don't have a connection to the server?
In this case, the client software should write to a local file on the user's hard disk.