Object - (Mutator|Setter|Set) method


Mutators are methods. Their role are to set the values of an object's state

The usages are:

  • central point of control for the input in order to reject bad data
  • change detection (if the value is not the same, a change has occurred and can be reported)

If the setter are private, the object is said to be immutable.

The Get method is the accessor while the Set method is known as the mutator method. See State - Mutable


Powered by ComboStrap