Generating IDL elements

 

Generating an IDL module

An IDL module is deduced from a UML package.  To allow IDL generation, the package must be stereotyped <<CORBAModule>>.  An empty UML package (a package without classes, type definitions or enumerates) does not give rise to IDL generation for module definition.

 

Embedded UML packages are mapped in the form of nested IDL module definitions.

 

Generating an IDL interface

An IDL interface is deduced from a UML class with public visibility.  To allow IDL generation, the class must be stereotyped <<CORBAInterface>>>>.  An IDL interface cannot be embedded in an IDL interface.  UML classes embedded in a class must include annotations, which allow them to be mapped in the form of IDL exceptions or IDL structure.

 

 

Generating an IDL structure

An IDL structure is deduced from a UML class with public visibility and is stereotyped <<CORBAStruct>>.  The UML class must not include operations.

 

 

Generating an enumeration

An IDL enumeration can be directly deduced from a UML enumeration.

 

An IDL enumeration can also be modeled as a class, stereotyped <<CORBAEnum>>.  The enum item is modeled by an attribute.

 

Generating an IDL constant

An IDL constant is modeled by an attribute stereotyped <<CORBAConstant>>, with the constant value expression represented by the attribute's initial value expression.  A class' attribute is generated as a constant, within the scope of the IDL interface.  For constants defined within a module, the attribute must be contained in a special class named Constants and stereotyped <<CORBAConstants>>.

 

 

Generating an IDL union

An IDL union is defined by a "CORBAUnion" class.  This class must have one and only one attribute or association.  Its name is the same name as the class, with the "_switch" suffix added.  The other attribute or associationEnd must be annotated with the {CORBACase(label)} tagged value.

 

 

Generating an IDL type definition

An IDL type definition can be modeled in two ways:

·         through a UML type to which a "CORBAIDL" note is associated

·         through a class stereotyped <<CORBATypedef>>

 

You must enter the definition of the type in its entirety in a "CORBAIDL" note.  Type definition that depends on another class must be modeled through generalization.  The dependency decides the generation order. 

 

 

Generating an IDL exception

An exception is modeled in the form of a UML class stereotyped <<CORBAException>>.  This class, which represents an exception, can be embedded in an IDL interface. For a class stereotyped <<CORBAException>>, it must not:

·         be in a generalization graph

·         have associations with other classes

·         have operations

 

To specify that an operation can raise an exception, a use link from the operation to the class representing the exception must be modeled.  This class is stereotyped <<CORBAException>>.  An operation can raise several exceptions.

 

 

Generating an asynchronous IDL operation

A UML operation is transformed into an asynchronous operation when the operation is stereotyped <<CORBAOneway>>.  For this type of operation:

·         the parameters must all be in "In" mode

·         the operation must not have return parameters

·         the operation must not raise exceptions

 

 

Generating a sequence

The "UML Profile for CORBA specification" indicates that in order to obtain the following idl code:

 

typedef sequence<MyClass> myClassSequence.

 

you should create a class named "MyClassSequence" and stereotyped <<CORBASequence>>, and then create an association (with multiplicity of 1). On this association, you must also create a qualifier named "index" on the opposite association end.

 

 

Generating an array

The "UML Profile for CORBA specification" indicates that in order to obtain the following idl code:

 

typedef MyClass MyClassArray[1];

 

you should create a class named "MyClassArray" and stereotyped <<CORBAArray>>, and then create an association (with multiplicity of 1).  On this association, you must also create a qualifier named "Index" on the opposite association end.

 

 

Generating a typedef

To generate a typedef, you should create a class named "MyTypedef" and stereotyped <<CORBATypedef>> and make this class specialize the "MyClass" class. 

 

If you wish to create a typedef from a primitive class (such as short or unsigned long), you must create a class stereotyped <<CORBAPrimitive>>.