IDL Objects

PowerDesigner supports modeling for all IDL objects.

Interfaces

PowerDesigner represents CORBA interfaces as standard classes with the <<CORBAInterface>> stereotype or as standard interfaces (to which a <<CORBAInterface>> stereotype is automatically applied). IDL interface properties are represented as follows:

IDL concept

PowerDesigner implementation

Inheritance between interfaces

Generalization link between classes with <<CORBAInterface>> stereotype

Readonly attribute

Readonly stereotype for attribute

Local interface

isLocal extended attribute set to True

Abstract interface

Abstract property selected in class property sheet

Interface declaration

Use inner link between <<CORBAInterface>> class and other items

Note:

You can draw associations between interfaces. Use an inner link to declare an item inner to another.

In the following example, the composition link indicates that an attribute in TestInterface uses the interface TestStruct as data type. The declaration inside the interface is performed with an inner link.



interface TestInterface {
 struct TestStruct {
  string member1;
 };

 attribute string StringA;
 attribute TestInterface::TestStruct MyStructAttr;
 void OperationA(inout TestStruct t, in string str);
 boolean OperationB(inout TestStruct t);
 
};

Modules

PowerDesigner represents CORBA modules as packages bearing the <<CORBAModule>> stereotype.

One IDL file is generated per package. The directory hierarchy follows the module hierarchy (and not the package hierarchy), so that only <<CORBAModule>> stereotyped packages are mapped onto file directories. #include directives are generated based on <<include>> stereotyped dependencies between packages and based on class shortcuts defined in a given package

Data Types

PowerDesigner represents CORBA data type as classes bearing the <<CORBAPrimitive>> stereotype, and fixed data types as classes bearing the <<CORBAFixed>> stereotype.

When you apply the <<CORBAFixed>>stereotype, the following extended attributes are automatically added to the class, for which you must define values:

  • digits: indicates the number of digits of the fixed-point decimal number

  • scale: indicates the scale of the fixed-point decimal number



typedef fixed<8, 3> Class_1;

General Constants

PowerDesigner represents CORBA general constants (values defined independently of any object and likely to be reused) as attributes created in a class, where both the class and the attribute bear the <<CORBAConstants>> stereotype.



const char red = 13325;
const char blue = 14445;
const long green = 26664;

Interface Constants

PowerDesigner represents CORBA interface constants (values defined for a specific interface) as attributes bearing the <<CORBAConstants>> stereotype, which are created in the interface where they will be used.



interface screen {
 const short background = blue;
 const short fields = green

Typedefs

PowerDesigner represents CORBA simple typedefs as classes bearing 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.



typedef num identifier;

Sequences, Anonymous Sequences, and Sequences in Structs

PowerDesigner represents CORBA sequences as classes bearing the <<CORBASequence>> stereotype. The upper bound of the sequence is specified by its UpperBound extended attribute, and its type is defined in another class linked to it by an association.



typedef sequence< string > name_lastname;

To avoid defining directly a type for a sequence to design sequence imbrication, use the <<CORBAAnonymousSequence>> stereotype.



typedef sequence< sequence< string > > Election_list;

To create a sequence in a struct, apply the <<CORBAAnonymousSequence>> stereotype to the sequence class.



struct Customer {
 string name_lastname;
 long age;
 sequence< string > w;
};

Valuetypes and Custom Valuetypes

PowerDesigner represents CORBA valuetypes as classes bearing the <<CORBAValue>> stereotype and custom valuetypes as classes bearing the <<CORBACustomValue>> stereotype. You can further define the valuetype as follows:

  • Inheritance between valuetypes has to be designed as a generalization between two valuetype classes

  • The interface supported by a value type is the one linked to the valuetype class with a generalization

  • Members of a valuetype are linked with a composition to the valuetype

  • You can declare an interface inside a valuetype using an inner link

  • Boolean extended attribute Istruncatable allows you to specify if the valuetype is truncatable or not

  • A value type factory operation is represented using an operation with the <<CORBAValueFactory>> stereotype



  • Code for DateAndTime:

valuetype DateAndTime : Time supports PrettyPrint {
 public DateAndTime::Date the date;
 factory init(in short hr, in short min);
 string get_date();
 
};

Boxed Values

PowerDesigner represents CORBA boxed values as classes bearing 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.



valuetype OptionalNameSeq sequence< myName >;

Enums

PowerDesigner represents CORBA enums as classes bearing the <<CORBAEnum>> stereotype, and enum elements as attributes bearing the <<CORBAEnum>> stereotype.

Structs

PowerDesigner represents CORBA struct types as classes bearing the <<CORBAStruct>> stereotype. You can mix attribute types in the struct class.

struct Customer {
 string name_lastname;
 long age;
};

You use composition links to define complex struct classes as defined in the following example:



struct Customer {
 string name_lastname;
 long age;
 Address references;
 Customer_Category belongs;
};

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.



struct A {
 struct B {
  short c;
  long d;
 } e, z;
 string x;
};

Unions

PowerDesigner represents CORBA unions as classes bearing 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.

To define the switch data type, the discriminant data type for union cases, you have to add an attribute named <class name>_switch to the list of union attributes.



union Test switch(char) {
 case 1:
  char Test1;
 case 2:
  string Test2;
 default:
  short Test3;
};

You can use an enum or a struct as a case in the union using a composition association.



union Customer switch(short) {
 case XYZ:
  char Last_Name;
 case ZYX:
  char Name;
 default:
  Identification uses;
};

The name of the attribute is on the association role and the case is on the association.

You can use an enum or a struct as a switch data type using a composition association. In this situation, the composition role is used as switch attribute for the union.



union Screen switch(Colors) {
 case red:
  short background;
 case blue:
  short foreground;
};

If you do not use the composition role as switch attribute, you still have to define a switch attribute in the Union.

Arrays

PowerDesigner represents CORBA arrays as classes bearing the <<CORBAArray>> stereotype. You must link the array class with another class representing the array type (use the <<CORBAPrimitive>> stereotype to define the type), and define the array dimension in the Dims extended attribute of the array class, a comma-separated list of the dimensions (integer values) of the array. It is used in place of the index<i> qualifiers on the associationEnd specified in the CORBA profile.

In the following example, array 2D_array uses string data type set to 10:



typedef string 2D_array[10];

You can use a class with the <<CORBAAnonymousSequence>> stereotype to avoid directly defining a type for an array for a sequence.



typedef sequence< string > 2D_array[10];

To define arrays for a union or a struct attribute, you have to use the multiplicity properties of the attribute.



union Customer switch(short) {
 case XYZ:
  char Last_Name[30];
 case ZYX:
  char Name[20];
};

You can also use the association multiplicity when the union or struct is linked with another class. The association role and multiplicity will become array attributes of the union or struct classes:



struct Client {
 char Name[30];
 short Age[3];
 European_Client European attributes[5];
};

Exceptions

PowerDesigner represents CORBA exceptions as classes bearing the <<CORBAException>> stereotype, where the class is declared as inner to the interface likely to raise the exception.

The list of exceptions is defined in the Exceptions tabbed page in the Implementation page of an operation, with no enclosing parentheses.



interface TEX {
 exception Badness2000 {
  string err_msg;
 };

 void process_token(in string tok) raises (Badness2000);
 
};


struct AdminLimit {
 PropertyName name;
 PropertyValue value;
};
exception AdminLimitExceeded {
 AdminLimit admin_property_error;
};