network. The skeleton resides in the server's address space and is in charge
of receiving and unmarshalling the client's request and of invoking the
corresponding server's operation. Similarly, the matched pair stub
is used to transmit the result of a server's operation to the client through the
network. The matched pair stub
skeleton is automatically generated at
compile time or at run time by the middleware used to network the client
and the server.
The Remote Method Invocation (RMI) is the Java mechanism for remote
object communication based on the stub
skeleton approach. The client can
invoke remote server methods by passing object arguments to the server's stub
and receiving object values from it. Thanks to RMI the client can pass objects
belonging to subclasses of the arguments supported by the server's methods. If
the server does not know the class, it downloads its code dynamically.
The mobile code paradigm
In most distributed object systems, the information that can be passed
between the client and the server is limited to a small number of primitive
data types, or references to other distributed objects, or structures made up
of these types and references. It seems natural to expect clients and servers
to be able to exchange fully-fledged objects carrying over both the data and
the code that manipulates them. This is possible using a different approach
from distributed computing, i.e. code mobility. Code mobility can be defined
as the capability to dynamically change the bindings between objects and
the location where they are executed.
The Java Applet technology supports code mobility in the form of code on
demand , where the client is a standard web browser and the server is a web
The programmer implements specific applets on the server side. When a
remote user accesses a web page containing a reference to an applet, the
applet's code is downloaded from the website and executed inside the
browser. The applet is not allowed to access the local resources on the client
side (e.g. its file system), but it sends data and commands to the remote
server (e.g. via RMI).
The declarative communication paradigm
Both the stub
skeleton and the mobile code paradigms require the client
and the server to commonly agree on a set of data structure definitions and
on the meaning of the operations on those structures. This is a strong
requirement that limits the possibility of integrating heterogeneous (e.g.
legacy) systems. An alternative approach has emerged from the distributed
artificial intelligence field: the definition of standard application-level
communication languages and protocols.
Distributed applications can cooperate since they share the same
communication language and a common vocabulary, which contains words