SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Thread: pageing pattern

  1. #1
    SitePoint Evangelist Scheisskopf's Avatar
    Join Date
    Nov 2004
    Location
    Southampton, UK
    Posts
    537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    pageing pattern

    are there any design patterns associated with pageing?

    cheers

  2. #2
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    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

  3. #3
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think it falls within the design pattern arena myself actually...

  4. #4
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Design patterns can most definately be used to describe user interfaces.
    http://www.welie.com/patterns/showPa...tternID=paging

  5. #5
    simple tester McGruff's Avatar
    Join Date
    Sep 2003
    Location
    Glasgow
    Posts
    1,690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  6. #6
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  7. #7
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    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 :
    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.
    Here, he clearly refers to the GoF Command and Decorator patterns as integral parts of the Front Controller.

    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.

  8. #8
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I can make some sense of that now, thanks

  9. #9
    SitePoint Guru dagfinn's Avatar
    Join Date
    Jan 2004
    Location
    Oslo, Norway
    Posts
    894
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •