CHAPTER 20
CORBA
CASE STUDYThe parameters maybe anyone of the primitive types such as
longand
booleanor one of the constructed types such as
structor
array. Primitive and structured types are described in more detail in Section 20.2.3. Our example shows the definitions of two
structsin lines 1 and 2. Sequences
and arrays are defined in typedefs, as shown inline, which shows a sequence of elements of type
Shape of length 100. The semantics of parameter passing areas follows:
Passing CORBA objects:
Any parameter whose type is specified by the name of an
IDL interface, such as the return value
Shapein line 7, is a reference to a CORBA
object and the value of a remote object reference is passed.
Passing CORBA primitive and constructed types:
Arguments of primitive and constructed types are copied and passed by value.
On arrival, anew value is created in the recipient’s process. For example, the
struct GraphicalObjectpassed as argument inline) produces anew copy of this
structat the server. These two forms of parameter passing are combined in the method
allShapes(in line whose return
type is an array of type Shape– that is, an array of remote object references. The return value is a copy of the array in which each of the elements is a remote object reference.
Share with your friends: