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

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 an attribute called declarator will be generated whose type will be set to sequence<type,dimension>.

Unbounded Sequence of User-defined Types

IDL SEMANTICS

sequence<type> declarator;

This construct can be represented in a Rose model as a relationship of unbounded cardinality which has the class which represents the user-defined type as its supplier.

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

declarator – name of the supplier role of the relationship

Note:  When the resultant IDL is reverse engineered an attribute called declarator will be generated whose type will be set to sequence<type>.

PROPERTIES

Attribute Properties

·  ArrayDimensions (String "") – If non-blank, indicates that the declarator is an array and defines the array dimension(s) portion of the declarator.

Role Properties

·  ArrayDimensions (String "") – If non-blank, indicates that the declarator is an array and defines the array dimension(s) portion of the declarator.

·  BoundedRoleType (Enumeration Array, Sequence) – Whether to use an array or sequence to represent a relationship with bounded cardinality.  Unbounded cardinality always generates an unbounded sequence.  The cardinality of the relationship defines the size of the array or sequence.

Note:  current implementation does not support multiple declarators though IDL grammar does. They are RE’d and subsequently FE'd as separate elements.

3.14  INTERFACE ATTRIBUTE

IDL Interface attributes can take several forms and are therefore variously represented in the Rose model.

3.14.1  Fundamental and Template Types

IDS SEMANTICS

[readonly] type declarator – where type is a fundamental type or template type other than sequence.  This construct is represented in a Rose model as an attribute.

readonly = Attribute.IsReadOnly property

type – attribute type

declarator – attribute name

3.14.2  References to User-defined Types

IDL SEMANTICS

[readonly] type declarator – 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.

readonly = Role.IsReadOnly property

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

declarator – name of the supplier role of the relationship

3.14.3  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

typedef type declarator_def[dimension]

[readonly] declarator_def declarator

This compound 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 'Array'.

readonly = Role.IsReadOnly property

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 nested class which represents the typedef will be generated.  That class will be the supplier in a relationship with the class which represents the interface.

Bounded Sequence of User-defined Types

IDL SEMANTICS

typedef sequence<type,dimension> declarator_def;

[readonly] declarator_def declarator

This compound 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'.