Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Mastering UML with Rational Rose 2002.pdf
Скачиваний:
137
Добавлен:
02.05.2014
Размер:
9.68 Mб
Скачать

Chapter 17: CORBA/IDL Code Generation and Reverse Engineering

Attribute/Role Ordering to set the order in which attributes and roles will be generated in the code

DocComment for comments that will be generated in the code

Attribute Properties

Attribute properties are the CORBA properties that relate specifically to attributes. Using these properties, you can control what is generated for each attribute in the model.

There are three places to set these properties. To set them for all attributes, select Tools → Options, then click the CORBA tab and select Attribute from the drop−down list box. To set them for only one attribute, select the CORBA tab on the attribute standard specification window, or open the CORBA specification window and edit the properties there.

575

Chapter 17: CORBA/IDL Code Generation and Reverse Engineering

Table 17.3 lists the attribute properties, their purposes, and their default values.

Table 17.3: CORBA Code−Generation Attribute Properties

Property

Purpose

Default

ArrayDimensions

Sets the array dimensions used for an exception,

<blank>

 

struct, or union when the BoundedRoleType

 

 

association property is set to Array

 

CaseSpecifier

Sets the label of the case statement of a union

<blank>

IsReadOnly

Controls whether the generated attribute is read only

False

Order

Sets the order of generated attributes and roles

<blank>

As with classes, these attribute properties, as well as some additional properties, can be set using the CORBA specification windows. The following shows the specification window for a CORBA attribute:

In the Name field, you can set or change the attribute's name. Whatever has been entered here will be used as the attribute name in the generated code. In the Type field, enter the data type (long, char, etc.) of the attribute. The Visibility field allows you to set whether the attribute is public or private. The Bounded Role Type field is used for an exception, struct, or union and determines whether to create an array or a sequence attribute to support a relationship with bounded multiplicity. The Array Dimensions, Case Specifier, and Is Read Only fields are identical to the ArrayDimensions, CaseSpecifier, and IsReadOnly properties described in Table 17.3. In the specification window, you can change either these fields or the properties.

Operation Properties

Operation properties are the CORBA code−generation properties that are specific to operations.

576

Chapter 17: CORBA/IDL Code Generation and Reverse Engineering

There are three places to set these properties. To set them for all operations, select Tools → Options, then click the CORBA tab and select Operation from the drop−down list box. To set them for only one operation, select the CORBA tab on the operation's standard specification window, or open the CORBA specification window for the operation and edit the properties there.

Table 17.4 lists the operation code−generation properties, their purposes, and their default values.

Table 17.4: CORBA Code−Generation Operation Properties

Property

Purpose

Default

OperationIsOneWay

Controls whether the one−way keyword will be

False

 

generated for the operation

 

Context

Includes a context statement for the operation

<blank>

Additional properties can be set through the CORBA Operation Specification window, as shown on the following page.

577

Chapter 17: CORBA/IDL Code Generation and Reverse Engineering

The Name, Return, and Arguments fields are used to set the operation's signature, including its parameters. The Visibility field controls whether the operation is public or private and will be directly used in code generation. The Raises field is used to set an exception class that will deal with exceptions for the operation.

Module Properties

Module properties are the properties that are related to the components in your Rose model. There are three places to set these properties. To set them for all components, select Tools → Options, then click the CORBA tab and select Module Specification from the drop−down list box. To set them for only one component, select the CORBA tab on the component's standard specification window, or open the CORBA specification window for the component and edit the properties there.

Table 17.5 lists the code−generation properties for components, their purposes, and their default values.

Table 17.5: CORBA Code−Generation Component Properties

Property

Purpose

Default

AdditionalIncludes

Used to enter any additional #include statements

<blank>

 

you want to see in the code

 

CmIdentification

Used to enter codes that your configuration

%X%%Q%%Z%%W%

 

management software can use

 

CopyrightNotice

Used to enter a copyright in the file

<blank>

InclusionProtectionSymbol

Sets the symbol that will be used to prevent a file

Auto Generate

 

from being included more than once

 

You can also set these values using the CORBA specification window for the component. To open the CORBA specification window, right−click the component and select Open Specification.

578