Rose/Corba mapping: introduction, IDL mapping, страница 3

switch_type_spec = class.ImplementationType property

case_expn = attribute/role.CaseSpecifier property of the nth attribute/role

typen = see the EXCEPTION, STRUCT, UNION ELEMENT TYPES section

declaratorn = name of nth attribute/role

default_type default_declarator = type and name of the attribute/role whose CaseSpecifier property is equal to 'default'.

PROPERTIES

Class Properties

·  ImplementationType (String "") – Switch type

Attribute Properties

·  CaseSpecifier (String "") – Case expression.  Should be equal to 'default' for the default case.

·  Order (String "") – Integer which defines the ordering of the struct elements.  If this property is not used the order is determined by the internal ordering of the Rose model.

Role Properties

·  CaseSpecifier (String "") – Case expression. Should be equal to 'default' for the default case.

·  Order (String "") – Integer which defines the ordering of the struct elements.  If this property is not used the order is determined by the internal ordering of the Rose model.

3.13  EXCEPTION, STRUCT, UNION ELEMENT TYPES

The elements of these IDL constucts can take several forms and are therefore variously represented in the Rose model.

3.13.1  Fundamental and Template Types

IDL SEMANTICS

type declarator[dimension_1]…[dimension-n] – where type is a fundamental type or template type.  This construct is represented in a Rose model as an attribute.

type – attribute type

declarator – attribute name

[dimension-1]…[dimension_n] – Attribute.ArrayDimensions property

3.13.2  References to User-defined Types

IDL SEMANTICS

type declarator[dimension_1]…[dimension-n] – where type is a user-defined type.  This construct is represented in a Rose model as a relationship of cardinality 1 which has the class which represents the user-defined type as its supplier.

type – scoped name of the class which represents the user-defined type

declarator – name of the supplier role of the relationship

[dimension-1]…[dimension_n] – Role.ArrayDimensions property

3.13.3  In-line Definition of User-defined Types

IDL SEMANTICS

type-definition declarator[dimension_1]…[dimension-n] – where type-definition is a complete definition of an struct, union, or enum.  This construct is represented in a Rose model as a relationship of cardinality 1 which has the class which represents the the user-defined type as its supplier.  The supplier class must be nested within the client class.

type-definition – definition of the IDL construct represented by the supplier class

declarator – name of the supplier role of the relationship

[dimension-1]…[dimension_n] – Role.ArrayDimensions property

3.13.4  Special Cases

These special cases are provided as convenient ways to generate the appropriate constructs.  They are applicable for one-time forward engineering only. If the resultant IDL is subsequently reverse engineered the resultant Rose model will differ from the original.  The differences are described below.

Singly-Dimensioned Array of User-defined Types

IDL SEMANTICS

type declarator[dimension] – This construct can be represented in a Rose model as a relationship of bounded cardinality which has the class which represents the user-defined type as its supplier without setting the Role.ArrayDimensions property if the Role.BoundedRoleType is set to 'Array'.

type – scoped name of the class which represents the user-defined type

declarator – name of the supplier role of the relationship

dimension – cardinality of the supplier role of the relationship

Note:  When the resultant IDL is reverse engineered a relationship with the Role.ArrayDimensions property set appropriately will be generated.

Bounded Sequence of User-defined Types

IDL SEMANTICS

sequence<type,dimension> declarator;

This construct can be represented in a Rose model as a relationship of bounded cardinality which has the class which represents the user-defined type as its supplier by setting the Role.BoundedRoleType property to 'Sequence'.