[Orbit-python-list] Implications of latest commits (your test suite)
Status: Inactive
Brought to you by:
tack
|
From: Jason T. <ta...@li...> - 2001-05-25 21:52:03
|
Okay. I fixed the particular segfault you reported when running your
test scripts. However, the objref changes I made aren't completely
user transparent. (Behaviour is more spec-compliant, mind you.)
For example, the old way allows this (what you were doing):
module Foo {
interface Bar {
oneway void baz();
};
};
import CORBA
orb = CORBA.ORB_init ((), CORBA.ORB_ID)
poa = orb.resolve_initial_references("RootPOA")
ior = open ("ior").readline ()
ref = orb.string_to_object (ior)
import Foo
ref.baz()
Note the last couple lines. You're creating the reference _before_ the
ORB knows about module Foo. ref becomes a CORBA.Object, but O-P still
lets you invoke on it, because according to the repo id of the object,
the operation exists, and so it goes ahead and marshals it.
With the new approach, you would either have to import Foo before
creating the objref, or _narrow() the object afterwards. So:
import Foo
ref = orb.string_to_object (ior)
ref.baz()
or:
ref = orb.string_to_object (ior)
import Foo
ref = ref._narrow(Foo.Bar)
ref.baz()
The old way may be more dynamic, but I think the current method is more
sane and predictable, and it behaves more like other ORBs. In practice,
though, I doubt this will really be much of an issue. And if it is, you
can use _narrow().
Jason.
|