[omniORB] Dereference FAQ?
Graydon Hoare
gray@interlog.com
Thu, 19 Mar 1998 11:55:19 -0500 (EST)
On Thu, 19 Mar 1998, Fredrik Jonsson wrote:
> The solution offered is based on maintaining an own hashtable but
> since it seems to be such a common situation I'm surprised that
> it is not standardized in Corba2. (As soon as you have two objects
> which interworks, and you dont want to publish implementation
> interfaces, you end up wanting to be able to dereference the object
> pointer to an implementation object.)
but.. it's really outside the scope of the service CORBA provides. I mean,
you can only go so far with code that requires objects are on the same
machine, in the same address space. If you really want network and
process transparency (the holy grail of corba) then you have to work your
entire design in IDL, so that implementation is never important. I'm
not saying this is always easy (I am working on code right now which sadly
does a dynamic downcast) but it is almost always possible. Just define
everything you ever want to see in IDL, and then stick to the contract of
never seeing anything else. You can always _narrow() to an interface which
exports all the data structures you are interested in as sequences of
CORBA::octets ;)
The only reason I'm downcasting is that the impl object has a pointer to
mmapped video memory, and I'd like to avoid having my ORB copying data
between visuals when we can keep the video processor doing that. But I
fully intend on making a fallback IDL for cases when the visuals aren't
on the same video card. It's really an exceptional circumstance..
-graydon