Remote Method Invocation

The object is the center of the Java world. Distributed object technologies provide the infrastructure that lets you have two objects running on two different machines talk to one another using an object-oriented paradigm. Using traditional networking, you would have to write IP socket code to let two objects on different machines talk to each other. While this approach works, it is prone to error. The ideal solution is to let the Java virtual machine do the work. You call a method in an object, and the virtual machine determines where the object is located. If it is a remote object, it will do all the dirty network stuff automatically.

Several technologies like Common Object Request Broker Architecture (CORBA) already exist, enabling developers to provide a clean, distributed programming architecture. CORBA has a very wide reach and is wrought with complexities associated with its grandiose goals. For example, it supports applications whose distributed components are written in different languages. In order to support everything from writing an object interface in C to handling more traditional object languages such as Java and Smalltalk, it has built up an architecture with a very steep learning curve.

CORBA does its job very well, but it does a lot more than you need in a pure Java environment. This extra functionality has a cost in terms of programming complexity. Unlike other programming languages, Java has distributed support built into its core. Borrowing ...

Get Database Programming with JDBC & Java, Second Edition 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.