This section describes more complex mappings between IDL and OOM objects.
Data Type
You create a CORBA data type using a class with the <<CORBAPrimitive>> stereotype.
General Constant
A general constant is a value defined independently of any object and likely to be reused. To declare a CORBA constant you have to create a class with the <<CORBAConstants>> stereotype, and then add attributes with <<CORBAConstants>> stereotype and initial values to this class.
Interface Constant
You create a constant for a selected interface by adding attributes with the <<CORBAConstants>> stereotype and initial values to this interface.
Typedef
You create a CORBA simple typedef using a class with the <<CORBATypedef>> stereotype. The typedef class should be linked to a class with the <<CORBAPrimitive>>, <<CORBAStruct>> or <<CORBAUnion>> stereotype through a generalization link in order to define the type of data.
Sequence
You create a CORBA sequence using a class with the <<CORBASequence>> stereotype. The type of the sequence is defined in another class linked to the sequence by an association. The UpperBound extended attribute of the <<CORBASequence>> class is used to define the upper bound of the sequence.
Valuetype
You create a CORBA valuetype using a class with the <<CORBAValue>> stereotype. You can further define the valuetype using the following design features:
Custom Value
You generate a custom valuetype using a class with the <<CORBACustomValue>> stereotype.
Boxed Value
You generate a boxed value using a class with the <<CORBABoxedValue>> stereotype. Since the boxed value does not support inheritance, or operations, you should use a class with the <<CORBAAnonymousSequence>> stereotype to associate a boxed value with an interface.
Enum
You create a CORBA enum using a class with the <<CORBAEnum>> stereotype. You declare enum elements by adding attributes to the class with <<CORBAEnum>> stereotype.
Struct
You create a CORBA struct type using a class with the <<CORBAStruct>> stereotype. You can mix attribute types in the struct class.
Struct Inside Another Struct
To define a struct inside another struct, create two classes with the <<CORBAStruct>> stereotype, add a composition between classes and use the inner link feature to declare one class as inner to the other.
Sequence in a Struct
To create a sequence in a struct, you have to use the <<CORBAAnonymousSequence>> stereotype on the sequence class.
Union
You create a CORBA union using a class with the <<CORBAUnion>> stereotype. Each attribute in a union represents a case, the Case extended attribute (in Profile\Attribute\Criteria\IDL union member\Extended Attributes) contains the case default value.
Enum / Struct in a Union
You can use an enum or a struct in a union using a composition association. The composition allows you to define the struct as a case in the union.
Struct / Enum as Switch Data Type
You can use an enum or a struct as switch data type using a composition association. In this situation, the composition role is used as switch attribute for the union.
Array
To create a CORBA array you have to perform the following actions:
Array for a Sequence
You can use a class with the <<CORBAAnonymousSequence>> stereotype to avoid defining directly a type for an array for a sequence.
Array for a Union or a Struct
To define arrays for a union or a struct attribute, you have to use the multiplicity properties of the attribute.
How to Raise an Exception
You define an exception using a class with the <<CORBAException>> stereotype, and declaring this class as inner to the interface likely to raise the exception.