Operations define the behaviors of the object.
While there are lots of different behaviors, they can often be broken down into four main categories.
- Those that manipulate data in some way. i.e. change a password
- Those that compute something. i.e. calculate the pay rate
- Those that check on a state of an object. i.e. is the status active
- Those that monitor the object for the occurrence of a controlling event. i.e. did an alarm trigger.
Those that manipulate data often have a set in their function name. Such as setPassword(). Those that check the state of an object usually return a boolean value, and use the is prefix, such as isActive().
Those that monitor or compute data should have meaningful names that help describe the function that they will be performing.
Defining Class Operations was originally found on Access 2 Learn