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

3.8  EXCEPTION

Maps to a Rose class with stereotype <CORBAException>.  The exception elements are defined by the attributes and relationships of the class.

IDL SEMANTICS

            exception identifier {type1 declarator1; type2 declarator2; … };

identifier = class name

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

declaratorn = name of nth attribute/role of the class

PROPERTIES

Attribute Properties

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

Role Properties

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

3.9  INTERFACE

Maps to a Rose class with stereotype <Interface>.

IDL SEMANTICS

            interface identifier [ : super1, super2, … ] { export_1; export_2; … };

identifier = class name

super  = name of superclass, if any

export = constant, exception, typedef, struct, union, enum, attribute, or operation

Note:  For a definition of the attributes and operations contained in an interface see the INTERFACE ATTRIBUTE and INTERFACE OPERATION sections.

Note:  Constants, exceptions, typedefs, structs, unions, and enums contained within an interface are mapped to nested classes within the class which represents the interface.

3.10  STRUCT

Maps to a Rose class with stereotype <CORBAStruct>. The struct elements are defined by the attributes and relationships of the class.

IDL SEMANTICS

struct identifier {type1 declarator1; type2 declarator2; … };

identifier = class name

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

declaratorn = name of nth attribute/role of class

PROPERTIES

Attribute Properties

·  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

·  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.11  TYPEDEF

Maps to a Rose class with stereotype <CORBATypedef>.

IDL semantics:

typedef type_spec declarator; or

typedef type_spec declarator[arraysize1][arraysize2]

type_spec = maps to the supplier class of a dependency relationship or the class.ImplementationType property.  See Note below for detailed discussion.

declarator = class name

[arraysize1][arraysize2]… = class.ArrayDimensions property

PROPERTIES

Class Properties

·  ImplementationType (String "") – Typedef type if there is no dependency relationship

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

Note:  The type_spec is defined in one of three ways depending on several factors. 

If the class has a dependency relationship to a class which is not one of its nested classes, then type_spec is the scoped name of the supplier class of that relationship.

If the class has a dependency relationship to one of its nested classes, then type_spec is the in-line definition of that class.  In this case the nested class must represent a struct, union, or enum.

Otherwise, type_spec is the class.ImplementationType property.

Note:  mapping does not support multiple declarators in one typedef even though IDL grammar does. They are RE’d and subsequently FE'd as separate typedefs.

3.12  UNION

 Maps to a Rose class with stereotype <CORBAUnion>. The union elements are defined by the attributes and relationships of the class.

IDL SEMANTICS

union identifier switch (switch_type_spec) {case case_exp1 : type1 declarator1; case case_exp2 : type2 declarator2; …; [ default : default_type default_declarator] };

identifier = class name