Previous Table of Contents Next


5.1 Overview

   Objects, more specifically, interface types that objects support, are defined by an IDL interface, allowing arbitrary implementations. There is great value, which is described in great detail elsewhere, in having a distributed object system that places almost no constraints on implementations.

   However there are many occasions in which it is desirable to be able to pass an object by value, rather than by reference. This may be particularly useful when an object’s primary “purpose? is to encapsulate data, or an application explicitly wishes to make a “copy? of an object.

   The semantics of passing an object by value are similar to that of standard programming languages. The receiving side of a parameter passed by value receives a description of the “state? of the object. It then instantiates a new instance with that state but having a separate identity from that of the sending side. Once the parameter passing operation is complete, no relationship is assumed to exist between the two instances.

   Because it is necessary for the receiving side to instantiate an instance, it must necessarily know something about the object’s state and implementation.

   Value types provide semantics that bridge between CORBA structs and CORBA interfaces: