14
.
Iterator
n
without exposing its representation
n
An extremely common pattern
n
For example, a list should support
forward and backward traversals
u
Certainly not by exposing its
internal data structure
n
Adding traversal methods to
List
’s
interface is a bad idea