The Iterator pattern in Design Patterns is similar, except that the Data Structure also supported the Data Source interface. Can't you just say that this is the Iterator pattern, except that you have a separate factory for the iterator?
-Ralph Johnson On Mon, Nov 22, 2010 at 8:53 PM, Jevon Wright <[email protected]>wrote: > Hi all, > > In our work we have noticed a fairly common data access pattern when > dealing with iterators (in Java, Iterator<T>) and iterator factories > (Iterable<T>), with respect to a given structure (T). This pattern is > illustrated in the attached image. Essentially it separates the > physical source of the data (such as a database, or memory) when it is > accessed iteratively. > > The Iterator must also be closable, so that it can clean up > references, close database connections etc. Jena has a similar > interface ClosableIterator. > > As far as we can tell, this has not been explicitly published > somewhere. Is anyone aware of a similar design pattern for data access > using iterators? > > Cheers > Jevon > > _______________________________________________ > patterns-discussion mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/patterns-discussion > >
_______________________________________________ patterns-discussion mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/patterns-discussion
