Relations between «CORBAInterface» classes are mapped to elements in the generated IDL depending on the type and multiplicity of the relation.
An outgoing or symmetric relation arrow leaving a «CORBAInterface» class can target only another «CORBAInterface» class. An incoming relation arrow coming into a «CORBAInterface» class can originate in either a regular class or another «CORBAInterface» class.
Outgoing or symmetric relations from «CORBAInterface» classes are mapped to accessor and mutator methods (such as get(), set(), add(), and clear()) in the generated IDL as follows:
For example, the following IDL is generated for the interface A, which has a directed relation to an interface B with a multiplicity of one:
interface A {
//// User-implicit entries ////
B getItsB();
void setItsB(in B p_B);
};
For example, the following IDL sequence definition is generated for interface C, which has a symmetric relation to interface D with a multiplicity of two:
typedef sequence<C> CSeq;
The CORBA::Class::IDLSequence property enables you to specify the implementation of the IDL sequence name, as follows:
A «CORBAInterface» can inherit only from another «CORBAInterface».
Inheritance between two «CORBAInterface» classes is generated into an inheritance between the corresponding IDL interfaces. For example, if a «CORBAInterface» H inherits from a «CORBAInterface» G, the following IDL code is generated for H:
interface H : G {};
An inheritance arrow between a regular class and a «CORBAInterface» is interpreted as a realization (implementation) of the interface. This structure is the typical architecture used to implement a CORBA server.
There are two ways to realize object adapters in CORBA:
The CORBA::Class::DefaultImplementationMethod specifies the implementation method (Inheritance or TIE) for the project. In other words, if DefaultImplementationMethod is set to Inheritance, all realizations of CORBA interfaces are implemented using inheritance by default.
For example, when using TAO and the inheritance implementation method, the following code is generated for class J, which inherits from «CORBAInterface» I:
class J : virtual public IBOAImpl {
public :
// Constructors and destructors
J(const char* instanceName = "");
-J();
};
In the generated code, the realizing class J inherits from the IBOAImpl class, which is generated by the TAO IDL compiler.
You can override the default implementation method by setting the CORBA::Class::TIERealizes or InheritanceRealizes property for a specific class to the name of the «CORBAInterface» classes that it realizes. In other words, even if you are using inheritance as the default implementation method for the project, you can still use TIE as the implementation method for a particular class by setting its TIERealizes property to the name of the «CORBAInterface» that it realizes. You can have the same class realize different «CORBAInterface» classes using different methods by setting the TIERealizes and InheritanceRealizes properties for the same class to the names of the «CORBAInterface» class that it realizes using either method.