This chapter covers the Iterator pattern.
GoF Definition
It provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
Concept
Iterators are generally used to traverse a container (or a collection of objects) to access its elements without knowing how the data are stored internally. It is very useful when you need to traverse different kinds of collection objects in a standard and uniform way. Figure
18-1 shows a sample and the most common diagram for an Iterator ...