CORBA types and business objects

CORBA basic types

Most of the CORBA types map directly onto C++ types and can be used transparently to C++. The following basic C++ types map directly into CORBA types:

All of these types are scoped to the CORBA class and must be declared accordingly. Their use in C++ is transparent and straightforward. For example:
CORBA::Short aShortvariable;
... 
aShortVariable = 12; 
...

CORBA types that return object references

Other CORBA types are not as straightforward to use because they return object references to the caller. The following CORBA types return object references to the caller:

It is the responsibility of the caller to manage the object references and their associated memory. There are two facilities provided by CORBA to do this:

A_var
This is the facility most frequently used by client code because it is a smart pointer that automatically releases its object reference when it is deallocated or assigned a new object reference. This is the safest and most straightforward approach to managing these types.
A_ptr
This is a pointer type that provides the most basic object reference, which has similar semantics to a standard C++ pointer.

Note: Avoid declaring C++ Static variables as _var. The _var holds a reference to an object. During the end of the process, this object might reference another object that was removed before end processing completes for this static type. As a result, the _var might reference an inappropriate address or null pointer and thereby cause an undesirable ending.


Related reference
CORBA programming reference



Searchable topic ID:   rcor_coptbo
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/corba/ref/rcor_coptbo.html

Library | Support | Terms of Use | Feedback