Creating Getter and Setter Methods
During the modeling process it is often necessary to create get/set methods for existing attributes. UModel supplies you with two separate methods to achieve this:
•Drag and drop an attribute into the operation compartment
•Use the context menu to open a dialog box allowing you to manage get/set methods
To create getter/setter methods using drag and drop:
•Drag an attribute from the Attribute compartment and drop it in the Operations compartment.
A pop-up menu appears at this point allowing you to decide what type of get/set method you want to create.
Selecting the first item creates a get and set method for interestRate:float.
To create getter/setter methods using the context menu:
1.Right-click the class title, e.g. SavingsAccount, and select the context menu option Create Getter/Setter Operations. The Create Getters/Setters dialog box opens displaying all attributes available in the currently active class.
2.Use the buttons to select the items as a group, or click the getter/setter check boxes individually.
|Note:||You can also right-click a single attribute and use the same method to create an operation for it.|