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.
![get-set1](./images/get-set1.png)
A pop-up menu appears at this point allowing you to decide what type of get/set method you want to create.
![get-set2](./images/get-set2.png)
Selecting the first item creates a get and set method for interestRate:float.
![get-set3](./images/get-set3.png)
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.
![get-set4](./images/get-set4.png)
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. |