245: Highlights
- Constructors, getters, and setters are called access methods. When you
move instance-variable accesses 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 understand.
- You can easily augment what a class provides.
- You can easily improve the way that data are 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.