I've run across this design issue a number of times and was wondering if there is a common OOP design pattern that addresses it.
Design Issue: I need to implement a class that represents a collection of objects that can get quite large. For performance reasons, the presentation layer will present the data in individual pages requesting only a small subset of the objects at a time as the user navigates through the data. Ideally the object would selectively query the DB on demand also instead of pre-loading everything into memory, when it is very likely that for really large collections the client/user won't ever request all of the data in the collection.
I've implemented this a number of ways, but none of them feel very modular, clean, or have a really intuitive interface.
Is there a common OOP design pattern for implementing an object that allows the client to pull the data one page at a time and is smart about querying the data from the data-tier only as needed?