I understand why, in RMI, you have to use a "cast" with Naming.lookup(..).
For example:

Foo f = (Foo)Naming.lookup(..)

And I can see why, when coding in straight CORBA, one would use the "narrow"
method, because narrow(..) is invoked off of an idl2java generated helper
class, and returns the correct type, without casting.

But, I can't figure out why the javax.rmi.PortableRemoteObject.narrow( )
even exists. The answer I was given was: "CORBA computability". But that
makes no sense to me. CORBA compatibility just means the ability to output
the IIOP wire protocol, right? And you could do that without the
PortableRemoteObject thing.

The reason I ask, is that I teach Java classes. My students ask me to
explain why we need to "cast" AND "narrow". I have not been able to give a
very satisfying answer.

Thanks,

Dave

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to