Software Engineering Architecture Lab

Iterator Pattern

Traverse a collection without exposing its internals. A behavioural pattern in the Design Patterns (GoF) catalog. With Java/Spring code.

Traverse a collection without exposing its internals.

Family
Design Patterns (GoF)
Category
Behavioural
Source
Gamma, Helm, Johnson, Vlissides · Head First Design Patterns

More behavioural patterns

  • Strategy — Swap interchangeable algorithms behind one interface.
  • Observer — Notify interested parties when something happens.
  • Command — Turn a request into an object you can queue, log, retry or undo.
  • State — Let an object change behaviour when its internal state changes.
  • Template Method — Fix an algorithm’s skeleton and let subclasses fill in steps.
  • Chain of Responsibility — Pass a request along a chain of handlers.
  • Mediator — Centralise complex communication between many objects.

All patterns