are there any design patterns associated with pageing?
cheers![]()
| SitePoint Sponsor |



are there any design patterns associated with pageing?
cheers![]()





I don't know much about these fancy patterns, but I set up my paging class to use iterators, so it can page things like arrays, db results, etc. I am not exactly sure what pattern the paging class itself follows, but looking at the iterator pattern might give you ideas.
"A nerd who gets contacts
and a trendy hair cut is still a nerd"
- Stephen Colbert on Apple Users





I don't think it falls within the design pattern arena myself actually...
Design patterns can most definately be used to describe user interfaces.
http://www.welie.com/patterns/showPa...tternID=paging





Iterators are handy since they hide the collection type. The same formatting code can be applied to database rows, csv fields, xml - whatever.
Seeking iterators (which allow you to set the cursor start position) are useful to pick out a subset of a large collection.





Interesting link Kyber, wasn't aware of such things, but now I have to ask, is it common to declare a new pattern, where that pattern - or algorithm - comprises several, more individualistic, patterns?
Architectural patterns often build on-top of structural patterns. Take Fowler's description of the notorious Front Controller :Originally Posted by Dr Livingston
Here, he clearly refers to the GoF Command and Decorator patterns as integral parts of the Front Controller.The Front Controller consolidates all request handling by channeling requests through a single handler object. This object can carry out common behavior, which can be modified at runtime with decorators. The handler then dispatches to command objects for behavior particular to a request.
The area of software design is not an exact science - patterns deal with methotologies, so they are bound to be fuzzy, and overlapping. Furthermore there is really no strict consensus on the form of the litterary genre of designpatterns. Some authors will be very concise and technical (like the original GoF patterns were) while others are more vague.
A topic such as UI is in it's nature of dealing with human perception rather hard to describe as comprehensive as something like the Iterator, so here you'll see some less "precise" descriptions. That doesn't make them less useful, but perhaps less suitable as cookbook-recipies.





Yes, I can make some sense of that now, thanks![]()




There is a Paging Iterator pattern in Clifton Nock's Data Access Patterns. I don't know if there's any information about it on the Web.
Dagfinn Reiersøl
PHP in Action / Blog / Twitter
"Making the impossible possible, the possible easy,
and the easy elegant" -- Moshe Feldenkrais
Bookmarks