| Lesson 10 | The ADT's interface |
| Objective | Understand what belongs in an ADT's interface. |
The struct ch_stack has a private part that contains its data description, and a public part that contains member functions
to implement ch_stack operations.
It is useful to think of the private part as restricted to the implementor's use, and the public part as a specification that clients may use.
These public members are also called the type's interface.
The implementor could change the private part without affecting the correctness of a client's use of the ch_stack type.
Here is an example of how we might test ch_stack's operations.
It is useful to think of the private part as restricted to the implementor's use, and the public part as a specification that clients may use.
These public members are also called the type's interface.
The implementor could change the private part without affecting the correctness of a client's use of the ch_stack type.
Here is an example of how we might test ch_stack's operations.