Class features Defining the features of an attribute When you click the Invoke Features window button or double-click an attribute, the Attribute window opens. This window is also displayed when you select an attribute in the browser and might have different options than shown in here. On the General tab, you define the general features for a attribute through the various controls on the tab. Љ In the Name box you specify the name of the attribute. The default name is attribute_n , where n is an incremental integer starting with 0. To enter a detailed description of the attribute, use the Description tab.
Љ You use the L button to open the Name and Label window to specify the label for the element, if any. For information on creating tables, see Descriptive labels for elements . Љ In the Stereotype list you specify the stereotype of the attribute, if any. For information on creating stereotypes, see Stereotypes for information on creating stereotypes. – To select from a list of current stereotypes in the project, click the Select Stereotype button . – To sort the order of the selected stereotypes, click the Change Stereotype Order button . Note: The COM stereotypes are constructive; that is, they affect code generation. Љ In the Attribute type area you specify the attribute type.
There are two ways to specify the type: – Select the Use existing type check box to select a predefined or user-defined type or class. Use the Type list to select from among the Rational Rhapsody predefined types, and any types and classes you have created in this project. Or to define a new type, delete the value in the Type drop-down list box to enable the Invoke Features window button and click it to open the Type window. For more information on creating types, see Composite types . – Clear the Use existing type check box if there is no defined type. A C++[Java] Declaration box displays in which you can give the attribute a declaration appropriate for your language edition.
See Modifying data types . Љ In the Visibility area you specify the type of access (visibility) for the accessor/mutator generated for the attribute: Public , Protected , or Private . When you generate code, each attribute is generated into three entities: – The data member itself – An accessor ( get ) method for retrieving the data value – A mutator ( set ) method for setting the data value Rational Rhapsody 69