Relations with «CORBAInterface» classes

Relations between «CORBAInterface» classes are mapped to elements in the generated IDL depending on the type and multiplicity of the relation.

Associations and aggregations

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:

Generalizations

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.

Note: Generally, for configurations with such a construct, the CORBA::Configuration::CORBAEnable property must be set to CORBAServer to avoid code generation errors.

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.

Compositions

«CORBAInterface» classes cannot be contained in any element. «CORBAInterface» classes themselves contain only «CORBAException» classes.


Feedback