413: Highlights
- Constructors, readers, and writers are called access
functions. When you move references and assignments into access
functions, you are practicing data abstraction.
- Data abstraction has many virtues, including the following:
- You can push details out of sight and out of mind.
- You can easily find the places where data are delivered and assigned.
- You can easily augment what a structure provides.
- You can easily improve how data are stored.
If you anticipate that the detailed definition of a
structure may change, then you should provide access functions for the
structure variables to isolate the effects of the potential changes.