Principles and Architecture / Design patterns / Behavioral
Iterator
Original notes by SunDiaL · View English source
The problem: You have a collection and you want to go through its elements. The solution: The foreach loop is syntactic sugar over Iterator (Enumerator in .Net).