Interface Navigation In Corba

moved from ComVsCorba


Is there some standard way to navigate from one CORBA interface on an object to another CORBA interface on the same object, when the interfaces are not related in any way by inheritance?

No, but the question does not make sense in a CORBA context. Unlike COM, a CORBA IDL definition defines the entire interface of an object, rather than one part of the MI hierarchy. That is, wherever you would use QueryInterface in COM, you would use multiple inheritance in CORBA. CORBA provides operations to cast between levels of the MI hierarchy, and, unlike COM, takes care of its implementation in languages that do not support MI directly. However, this does (as has been pointed out) cause difficulties with versioning.

A function on one interface can return other objects/interfaces. One could have a convention that some function on Interface1 would return an Interface2 pointer to the same instance. But this wouldn't solve the versioning problem, because the old "Interface1" above can't refer to Interface1.v2 until Interface1.v2 exists.

It would also cause problems with determining object identity because CORBA thinks of each CORBA interface as a single object with a well defined identity, rather than giving the implementation object an identity. So there are multiple CORBA objects that happen to be implemented by a single (hidden) implementation object -- in this way it's a bit like the FlyweightPattern.


EditText of this page (last edited March 19, 2003) or FindPage with title or text search