Monday, August 20, 2007

What is the difference between Java IDL and RMI-IIOP?

What is the difference between Java IDL and RMI-IIOP?

This is a fundamental question and it's important to understand the distinction between these two ways of integrating the Java programming language with CORBA.

Java IDL is for CORBA programmers who want to program in the Java programming language based on interfaces defined in CORBA Interface Definition Language (IDL). This is "business as usual" CORBA programming, supporting Java in exactly the same way as other languages like C++ or COBOL.

RMI-IIOP (Remote Method Invocation over Internet Inter-ORB Protocol) is for Java programmers who want to program to the RMI interfaces, but use IIOP as the underlying transport. RMI-IIOP provides interoperability with other CORBA objects implemented in various languages - but only if all the remote interfaces are originally defined as Java RMI interfaces. It is of particular interest to programmers using Enterprise JavaBeans (EJB), since the remote object model for EJBs is RMI-based.

There are several scenarios that will define how you will want to create distributed CORBA applications. Here are some of them:

· Java IDL! If you have been developing CORBA applications using IDL for some time, you will probably want to stay in this environment. Create the interfaces using IDL, and define the client and server applications using the Java programming language to take advantage of its "Write Once, Run AnywhereTM" portability, its highly productive implementation environment, and its very robust platform.

· RMI-JRMP! If all of your applications are written in the Java programming language, you will probably want to use Java RMI to enable communication between Java objects on different virtual machines and different physical machines. Using Java RMI without its IIOP option leverages its strengths of code portability, security, and garbage collection.

· RMI-IIOP! If you are writing most of your new applications using the Java programming language, but need to maintain legacy applications written in other programming languages as well, you will probably want to use Java RMI with its IIOP compiler option.

Some rule:

Java Objects can communicate with CORBA objects and vice versa.

When you want a java program to talk to a CORBA object, use JavaIDL and when you want CORBA objects to talk to Java Objects, use the ubiquitous EJB.

95 When should you use Java IDL and when should you use RMI-IIOP?

A You should use Java IDL when using Enterprise Javabeans.

B You should use RMI-IIOP when using Enterprise Javabeans.

C You HAVE to use RMI-IIOP when using Enterprise Javabeans.

D Java IDL can be used even if the remote interfaces were originally defined as RMI interfaces.

E RMI-IIOP can be used with CORBA only if the remote interfaces were originally defined as RMI interfaces.

F RMI-IIOP can be used with CORBA even if not all of the remote interfaces were originally defined as RMI interfaces.

G It comes down to programmer preference as both can be used in all situations.

Choices B and E are correct.

The following is taken from:http://java.sun.com/j2se/1.3/docs/guide/idl/index.htmlThis is a fundamental question and it's important to understand the distinction between these two ways of integrating the Java programming language with CORBA. Java IDL is for CORBA programmers who want to program in the Java programming language based on interfaces defined in CORBA Interface Definition Language (IDL). This is "business as usual" CORBA programming, supporting Java in exactly the same way as other languages like C++ or COBOL. RMI-IIOP (Remote Method Invocation over Internet Inter-ORB Protocol) is for Java programmers who want to program to the RMI interfaces, but use IIOP as the underlying transport.

RMI-IIOP provides interoperability with other CORBA bjects implemented in various languages - but only if all the remote interfaces are originally defined as Java RMI interfaces. It is of particular interest to programmers using Enterprise JavaBeans (EJB), since the remote object model for EJBs is RMI-based. Choice A is incorrect; Java IDL has nothing to do with Enterprise Javabeans. In choice C you can use JRMP instead of IIOP if you want. So this choice is incorrect. Choice D is incorrect because Java IDL requires CORBA interfaces not RMI interfaces. Choice F is incorrect as all the interfaces must be defined as RMI interfaces. Choice G is incorrect because although sometimes Java-IDL and RMI-IIOP could be used for the same thing, generally a situation will suit one more than the other.

0 comments: