Getter or Setter operations are special types of operations you create for an attribute. You create them for sending and receiving data values between attributes of a class or of an interface.
You create a Getter or a Setter operation from the list of attributes. For each attribute, you can create a Getter, a Setter, or both a Getter and Setter operations.
Operation |
Description |
---|---|
Getter |
Returns a value from an attribute |
Setter |
Sets a value into an attribute |
C# exception: In C#, if you have an attribute with the <<Event>> stereotype, the default methods are not Getter and Setter but Add and Remove. When you click the Add Accessors button, the Add and Remove methods are automatically added.