03-11-2012, 02:22 PM
CORBA vs. RMI
CORBA vs. RMI.docx (Size: 14.25 KB / Downloads: 25)
CORBA vs. RMI
Code-wise, it is clear that RMI is simpler to work with since the Java developer does not need to be familiar with the Interface Definition Language (IDL). In general, however, CORBA differs from RMI in the following areas:
• CORBA interfaces are defined in IDL and RMI interfaces are defined in Java. RMI-IIOP allows you to write all interfaces in Java.
• CORBA supports in and out parameters, while RMI does not since local objects are passed by copy and remote objects are passed by reference.
• CORBA was designed with language independence in mind. This means that some of the objects can be written in Java, for example, and other objects can be written in C++ and yet they all can interoperate.
Therefore, CORBA is an ideal mechanism for bridging islands between different programming languages.
• On the other hand, RMI was designed for a single language where all objects are written in Java. Note however, with RMI-IIOP it is possible to achieve interoperability.
• CORBA objects are not garbage collected. As we mentioned, CORBA is language independent and some languages (C++ for example) does not support garbage collection. This can be considered a disadvantage since once a CORBA object is created, it continues to exist until you get rid of it, and deciding when to get rid of an object is not a trivial task. On the other hand, RMI objects are garbage collected automatically.
• CORBA lets you mix programming languages. In other words, you can write your client programs and the distributed objects in any CORBA supported programming language, including Java, C++, C and so forth. RMI, of course, only supports Java, both on the client and the server.
• CORBA is geared toward larger, more scalable systems, where you might have thousands of objects. CORBA is more complex to program and deploy than RMI, but lets you develop enterprise-level systems, where you need support for transactions, security and so forth. The CORBA Naming Service is also more powerful and flexible than the RMI Naming Registry.