Previous | Table of Contents | Next |
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:
• They support description of complex state (i.e., arbitrary graphs, with recursion and cycles)
• Their instances are always local to the context in which they are used (because they are always copied when passed as a parameter to a remote call)
• They support both public and private (to the implementation) data members.
• They can be used to specify the state of an object implementation (i.e., they can support an interface).
• They support single inheritance (of valuetype) and can support an interface.
• They may be also be abstract.