Chapter 9. Remote Method Invocation and Object Serialization

So far, I have talked a lot about how to build a program. But just as all programs can be broken down into more basic objects, most programs these days are part of a larger system of interacting programs. Breaking a system apart into a number of different programs has a lot of advantages, including independence of failure, security through isolation of parts, and the ability to change parts without interrupting the overall system. But it also requires that there be some way for the various programs to interact.

Historically, programs have interacted in different ways depending on how those programs were deployed. Programs that were guaranteed to run on the same computer would interact using inter-process communication mechanisms (IPCs), whereas programs that might be running on different computers would use some form of network communication. The communication might take a low-level form such as sockets, where the communicating programs send bits over the wire and are responsible for interpreting those bits. But since the early 1980s, a more common form of communication has been remote procedure call (RPC), which wraps much of the mechanism used to communicate between programs in a façade that makes the communication look like a procedure or method call.

Java’s Remote Method Invocation (RMI) system is, on the surface, such a remote procedure call mechanism. Indeed, over the years, RMI has been expanded in a number of ways ...

Get Java: The Good Parts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.