284: Highlights
- Getters, setters, and instance-creation methods are called access methods. When you
move instance-variable evaluations and assignments into access methods,
you are practicing data abstraction.
- Data abstraction has many virtues, including the following:
- Your programs become easier to reuse.
- Your programs become easier to read.
- You can augment what a class provides.
- You can improve the way information is stored.
If you anticipate that the detailed definition of a class may change,
then you should provide access methods for the instance variables to
isolate the effects of the potential changes.