Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

26.4 Objects by Value

CORBA 2.3 offers the feature of objects by value. This mechanism allows C++ objects to be passed by value in an IDL operation instead of by reference. Passing by value means passing the internal state of an object as an operation parameter or return value, and constructing a copy of the object on the far side.

Without some mechanism to pass objects by value, only types that are explicitly described in the CORBA IDL can be passed in an IDL operation. To pass a C++ object without an objects-by-value mechanism, you must first define an IDL type (typically an IDL structure) to represent the state of the object. This type is passed as an operation parameter and used to create a new instance of the object on the other side. This process requires that you manually marshal (copy the object on the wire) and unmarshal (read the object from the wire) the object every time it is passed.

The manual process becomes especially tedious when you want to pass a non-trivial object, such as a collection. In this case, you must extract some state from each element in the collection into an IDL structure, and store each of those structures in an IDL sequence. You pass the sequence as an operation parameter and then, on the other side, create a new collection and populate it with new objects, constructed from the structures in the sequence.

The orb library replaces this whole process with an easier procedure, making it much easier to manage, as explained in the next section.

26.4.1 Orbix and Opaque

Orbix is an ORB implementation made by IONA Technologies. Although Orbix 2.1 was released before CORBA 2.3, the ORB offers features in addition to those required by CORBA 2.0. One of these features is the Orbix opaque mechanism, which allows C++ objects to be passed by value in an IDL operation instead of by reference. Because the orb library takes advantage of the Orbix opaque mechanism, the orb library supports only the Orbix ORB. An example of this procedure for passing objects by value is provided in Section 27.2.

For more information on Orbix or the opaque mechanism, please consult your Orbix documentation or the IONA web site, http://www.iona.com/products/orbix/index.html.


NOTE: This Web link was accurate when this manual was created, but may be changed by IONA at any time.

Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.