Chapter 3 Building Structural Diagrams
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 |
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.
To add a Getter and a Setter operation to a classifier from an attribute:
Copyright (C) 2006. Sybase Inc. All rights reserved. |