CORBA Connectivity: IDL to C# Type Mapping

In this section we will give a brief overview of the J-Integra® Espresso IDL-to-C# language mapping. Most IDL types have a direct C# counterpart. IDL identifiers will be directly mapped into C# identifiers and a module is represented by a C# name space. C# keywords which are used as IDL identifiers are prefixed by an underscore. Interfaces, Structures, and Unions receive an additional name space with the suffix 'Package' to accommodate new definitions of types within the corresponding type or interface name spaces.

Basic Data Types

The following table gives a listing of the basic IDL data types and their representation in C#.

IDL TYPE C#
boolean bool
char char
wchar char
string string
wstring string
octet byte
short short
unsigned short ushort
long int
unsigned long uint
long long long
unsigned long long ulong
float float
double double
long double double

Interface

Interfaces are directly mapped to their C# counterparts. 'Attributes' defined in the IDL interface become C# properties.

Helper Classes

.NET Helper Classes are generated for any user defined type (using the type name with the suffix 'Helper'). Helpers will provide static methods for the following:

Most of the time, only the last piece of functionality is needed by the developer.

Typedef

Similar to Java, the IDL statement 'typedef' does not introduce a new type in C#. It only forces 'Helper' classes to be generated. Since C# does not know 'typedefs', the original type has to be used in the application code. The 'Helper' class provides the repository id for the corresponding CORBA type.

Constant

C# does not allow for a global definition of constants. CORBA constants are therefore represented as 'structs' with one member called 'value' (i.e. the constant is set by assigning [constant].value = [some value]).

Constructed Data Types

Constructed types comprise structures, enumerations, and unions.

Array and Sequence

Arrays as well as sequences are mapped to C# arrays. They usually appear in conjunction with 'typedefs' or 'constructed types'.

CORBA Pseudo Objects

A CORBA Object is by definition a remote object offering a remote interface to the client. Nevertheless, there are some objects defined in terms of IDL (for the sake of correctness: PIDL - Pseudo IDL) within the CORBA standard which are not remote but necessarily local (like the ORB interface), or objects which are mandatorily transported by value: