|
||
|
The ADT's interface
Hiding data is an important component of OOP. You need to give careful consideration to which components should be left
public and which should be left private. In general, data members are private, with the functions that
allow you to examine and change them kept public. If too much is left public, then tampering and misuse of
implementation details can result.
If too much is left private, then inefficiencies and access problems can result. If you properly gauge public and private portions of an object, then code is more easily debugged and maintained because errors and modifications are localized. Client programs need only be aware of the type's public interface specification. |
||
|
|
||