[omniORB] DSI and interface inheritance

David Riddoch djr@uk.research.att.com
Fri, 30 Jul 1999 09:25:15 +0100 (GMT)


On Tue, 27 Jul 1999, Tom Kelly wrote:

> 
> I have a problem with interface inheritance and DSI in omniORB
> 
> Consider the following idl files:
> A.idl:
> interface A{
>   // Some operations
> };
> 
> B.idl
> #include "A.idl"
> interface B: A{
>  // some more operations
> };
> 
> Now if I have a DSI implementation of B, I register it with:
> CORBA::Object_ptr obj = 
> 		boa->create_dynamic_object(new DynImp_B,"IDL:B:1.0");
> 
> When clients that can only see the A interface attempt to use this object
> they cannot narrow it to an A; the client makes a GIOP _is_a request and
> the server does not recognise that B is derived from A. 


You should see the _is_a operation invocation in your
DynamicImplementation::invoke() routine -- so you have the opportunity to
decide whether or not the object supports a particular interface.  If
instead you throw a BAD_OPERATION exception, then the ORB tries the
default version (which of course won't say yes).

I expect that the POA will give you a better solution when it comes...


> How then do you create dynamic objects that support the base and inherited
> interface at the same time? (indeed how do you support two interfaces on
> the same dynamic object?) 

Supporting two interfaces is not problem -- just say yes to the _is_a
question for both repository id's.


Hope that helps,
David