This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes when to use rmi-iiop versus idl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "when to use rmi-iiop versus idl" Watch "when to use rmi-iiop versus idl" New topic

when to use rmi-iiop versus idl

jason white
Ranch Hand

Joined: Aug 08, 2005
Posts: 60
Need help understanding why I would use rmi-iiop in an ejb-to-corba solution but in a pojo-to-corba solution I would use idl...

Is it as simple as the fact that an ejb container implements rmi and does idl generation for you? If so, how does it know what ORB type to implement?

I am confused...

I have looked in the CORBA spec, on the java tutorials for both idl and rmi and read cade's book on the love [banghead]
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

"boarderx" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy. User names cannot be obviously fake and must constist of a first name and a last name.

You can change your user name here.

The EJB container generates stubs using RMI-IIOP - this means that the developer writing the code writes regular RMI interfaces (or EJB interfaces in this case), but when stubs are generated, the implementation of the stubs "talk" using IIOP - the same protocol that CORBA uses. I'm not completely sure that there's a "real" CORBA ORB running the RMI-IIOP stubs - the Java RMI system could be enough of an "ORB" for this - or maybe the application server comes with a "real" ORB - in this case it would then know the specific ORB it was going to use.

As far as when to use RMI, when to use IDL, and when to use RMI-IIOP - there's a section on that in the RMI over IIOP Documentation provided by Sun.

The reason that you have to use RMI-IIOP in EJB is simple - it's a required part of the EJB spec.

Thanks! and welcome to the JavaRanch!
[ August 09, 2005: Message edited by: Nathan Pruett ]

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
jason white
Ranch Hand

Joined: Aug 08, 2005
Posts: 60
Thanks Nathan!
Michael D. Brown

Joined: Nov 22, 2003
Posts: 29
Here is another piece of advice. If you already have IDL files for an existing CORBA application, using Java-IDL is a good idea since it generates the appropriate Java interfaces for the IDL. If you want to, you can implement the interfaces using RMI-IIOP or EJB depending on the needs of your application.
I agree. Here's the link:
subject: when to use rmi-iiop versus idl
It's not a secret anymore!