Multiple choice technology architecture

You are not allowed to expose the internal representations of your complex collection / array data type. How do you to fetch elements one after another?

  1. Looper pattern

  2. Visitor pattern

  3. DataAccess pattern

  4. Iterator pattern

  5. None of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The Iterator pattern provides a way to access elements of a collection sequentially without exposing its underlying representation. It defines a uniform interface for traversal, whether the collection is an array, list, tree, or any other structure. Looper isn't a standard pattern, Visitor adds operations without changing classes, and DataAccess isn't a GoF pattern.