RMI is an object-oriented approach for RPC.
On the client side, there is a Stub and a Skeleton on the server side. The client and server do not directly exchange data, but they exchange data via Stub and Skeleton, which are automatically generated.
As you can guess, there must be some objects that the server and client should use. These objects are defined on the server side and are stored in the RMI Registry . Both the server and the client can call the RMI registry and somehow it works like memory (this is not memory, this is an example that should be clear). The server associates the object with the registry, and the client calls methods on it.
source share