[omniORB] Do _narrow() always result in net traffic?

Sai-Lai Lo S.Lo@uk.research.att.com
03 Nov 1999 17:03:46 +0000


omniORB has implemented what you have described for a long long time. All
of these, including when the ORB will contact the remote objects, are fully
documented in Chapter 6 "Interface Type Checking" of the user guide.


>>>>> Frank Lynch writes:

> I'm not certain how omniORB implements this but other ORB's I've used have the
> following behaviour....

> _narrow() does not normally result in a remote call, however there is one
> situation (that I know of) where it does....

> This happens in a situation where in a server you create an object say
> checkingAccount that inherits from Account,and  your client only has stub code
> for Account. 

> // Psuedo - IDL
> interface Account {...}
> interface CheckingAccount : Account {...}

> 1. Your server creates and publishes a CheckingAccount object.

> 2. Your client obtains an Object reference (from the NS or a file) and
> attempts to narrow the CORBA Object to an Account proxy. The type_id in the
> IOR will refer to the type CheckingAccount, which your client has no knowledge
> of (as it only has stub code for the Account type). In this situation the call
> to Account::_narrow(obj); results in a remote _is_a(). If CheckingAccount
> inherits from account (as is this case) the _is_a() will succeed and the
> narrow will succeed, otherwise the narrow will return a nil object.



-- 
Sai-Lai Lo                                   S.Lo@uk.research.att.com
AT&T Laboratories Cambridge           WWW:   http://www.uk.research.att.com 
24a Trumpington Street                Tel:   +44 1223 343000
Cambridge CB2 1QA                     Fax:   +44 1223 313542
ENGLAND