====== 01_Iterator:イテレーター ====== title Iterator interface Aggregate{ createIterator() } interface Iterator{ +hasNext() +next() } class BookShelf{ createIterator(this) } class BookShelfIterator{ BookShelf +hasNext() +next() } Aggregate -> Iterator : Create Aggregate <|.. BookShelf Iterator <|.. BookShelfIterator BookShelf <-o BookShelfIterator ====== 概要====== BookShelfのcreateIteratorメソッドを使ってBookShelfIteratorを作成する。 その際、BookShelf自身を渡すことで、BookShelftとBookShelfIteratorは疎結合となっている。