Java Reference
In-Depth Information
Chapter 20
Distributed computing - putting
it all together
20.1 Introduction
Chapter 16 introduced distributed computing, the UML notation language, and
the design of the server side of a client/server application. Chapter 17 described
the client side. Before beginning an actual implementation, it was necessary to
describe Java RMI in Chapter 18. Then we took a brief detour in Chapter 19
to describe CORBA as an alternative to RMI. Now that we have all the pieces,
we can put them together to build a simple example of a distributed comput-
ing application in which the calculation engine is implemented completely in
Java. If the calculation engine involves legacy code in a language other than
Java, then we must use JNI (the Java Native Interface, which is described in
Chapter 22).
20.2 The sample application
A real client/server application using the design of Chapters 16 and 17 will
be more complex than the sample described here. In fact, if the application
were not somewhat complex, there would be little reason to implement it in a
client/server design in the first place! However, for the sake of demonstration
purposes and to provide a template for the reader's own applications, we provide
a simple application that illustrates the important features of the client/server
design presented in Chapters 16 and 17.
Recall that the client/server system designed earlier assumed a time-dependent
simulation - i.e. one with a solution that varies as a function of time. The same
approach could also work with monitoring and controlling a real system such as
a remote sensor. We wish for the simulation code to return a periodic “snapshot”
of the solution as a function of time as the simulation runs. Alternatively, in the
case of monitoring a remote sensor system, we could return periodic data as it is
collected from the sensor. For our demonstration, we need either a time-dependent
simulation problem to use as an example or a remote sensor or experimental
549
Search WWH ::




Custom Search