We try to compare CORBA, RMI, and DCOM from different perspectives. Table 2 at page 17 shows some basic component comparison results among the three.
CORBA RMI DCOM Object Implementation Diverse languages can be used as long as the IDL can be mapped to that language.
Only Java language can be applied, because the Java Object Serialization usage.
Specification is at the binary level. Diverse languages like C++, Java, Delphi, and even COBOL can be used.
Client/Server Interface The client stub is called a stub, and the server side is skeleton.
The client stub is called a stub, and the server side is skeleton.
The client stub is called a proxy, and the server side is called stub.
Remote Protocol Internet Inter-ORB Protocol (IIOP)
Java Remote Method Protocol (JRMP)
Object Remote Procedure Call (ORPC)
Object Identification Object references (objref) are used as the object handle at run-time.
A remote server object is assigned with an ObjID as its identification.
Interface pointer is used as a unique identifier for a remote server object.
Object Location and Activation The ORB is used to locate an object, and Object Adapter is used for activation.
The object location and activation are on Java Virtual Machine (JVM)
Use the Service Control Manager (SCM) to locate and activate an object.
Inheritance Support multiple inheritance at the interface level. Every interface inherits from CORBA.Object
Support multiple inheritance at the interface level. Every object implements java.rmi.Remote
Supports multiple interfaces for objects. Every object
implements IUnknown.
On-demand Activation A client can bind to a naming or a trader service to activate a server object by obtaining a server reference.
A client can do a lookup() on the remote server object’s URL name to obtain the object reference.
A client can do a CoCreateInstance() to activate a server object.
Exception Handle Exceptions are thrown at the interface definition. Exception handling is taken care of by Exception Objects.
Exceptions are thrown at the interface definition. Exceptions are serialized and marshaled back across the wire.
Exceptions are thrown out to HRESULT to be handled. For richer exception handling, it uses Error Objects, and ISupportErrorInfo interface has to be implemented.
Garbage Collection Does not attempt to perform general purpose distributed garbage collection.
Attempts to perform distributed garbage collection of remote server objects using the mechanisms bundled in the JVM.
Attempts to perform distributed garbage collection on the wire by pinging. The DCOM wire protocol uses a Pinging mechanism to garbage collect remote server object references.
Table 2 remarks: Unlike CORBA and RMI, which support multiple inheritance at the interface level, DCOM supports multiple interfaces for objects and uses the QueryInterface() method to navigate among interfaces. This means that a client proxy dynamically loads multiple server stubs in the remote layer depending on the number of interfaces being used. RMI relies heavily on Java Object Serialization, which requires objects to be coded using Java. DCOM and CORBA are relative more portable in object implementations. Both RMI and DCOM try to perform distributed garbage collection. RMI takes the advantage of the mechanisms bundled in JVM, and DCOM uses a Pinging mechanism to garbage collect remote server object references. Finally, in terms of usability, RMI can be run at any platform as long as the JVM implementation is there; DCOM requires a COM Service implemented platform; and CORBA can be implemented if a CORBA ORB exists.
An implementation example is provided in [8], which uses Java to implement a stock price query system (client/server) using the three models. Each of the implementations defines an IStockMarket interface and a get_price() method that returns a float value indicating the stock value of the symbol passed in. The example gives some inside look from practical point of view.