the iterator pattern in oops - Search