Design patterns·Who calls whom, and when
you walked the collection without knowing whether it was an array, a tree or a paged remote call.
Iterator pattern
Also callediterator, cursor, enumerator
Providing sequential access to the elements of a collection without exposing how it is stored. It is the clearest case of a pattern that became a language feature — foreach, iterators and generators are the pattern built in — which is why it is worth knowing mostly as history and as an interview example. The one live concern it still raises is what happens when the underlying collection changes mid-iteration.