[omniORB] omniORB 3.0.x

Duncan Grisby dgrisby@uk.research.att.com
Thu, 11 Jan 2001 10:31:51 +0000


On Wednesday 10 January, "Jeff Schnitzer" wrote:

> Unfortunately I need to be able to burst an array of structures across
> the wire on a single remote call, so I (apparently) need valuetypes.
> I'm bewildered that CORBA had no standard way to send structs until so
> recently; Microsoft has had structs in the DCOM IDL for years.

CORBA has always had structs and other complex constructed types. The
problem is that with most types in Java it is acceptable to use a nil
reference to indicate the absence of an object. The original CORBA
types have no way to represent that (although it has always been
possible to fake it with unions or bounded sequences). Part of the
objects by value specification adds "value boxes", which either
contain the boxed type, or nil. So, you can have IDL like

  valuetype StringValue string;

which is a type containing either a normal string, or nil. The Java to
IDL mapping maps lots of things like that.

The other problem is that with RMI, you can transmit objects which
have behaviour as well as state. This relies on being able to transmit
compiled code (via HTTP) if the receiving process doesn't have it.
This clearly isn't going to work when transmitting to a language other
than Java. But CORBA has a go anyway. You can declare a valuetype like

  valuetype Foo {
    public long l;
    public string s;
    long doSomething(in short a, in boolean b);
  };

When you receive one of those, you have to hope that you have an
implementation of the doSomething() method, or you can get one from
somewhere. Java can, in theory, transmit the code by HTTP as with RMI,
but I'm not sure if it actually does yet. You could do the same thing
with Python, as long as both client and server were Python. With C++,
there's no hope at all.

Anyway, it's all horribly ugly. If you want to be totally confused,
read the section of the GIOP spec about marshalling valuetypes. It's
going to be a long time before interoperability between ORBs is as
good with valuetypes as it is with the other types.

That said, we will probably support valuetype in the next major
releases of omniORB and omniORBpy. No promises, though.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --