Re: pager

[prev] [thread] [next] [Date index for 2004/10/21]

From: David R. Baird
Subject: Re: pager
Date: 10:46 on 21 Oct 2004
On 20 Oct 2004 at 19:55, Randal L. Schwartz wrote:

> >>>>> "David" == David R Baird <dave@xxxxxxxxxxxxx.xx.xx> writes:
> 
> David> I've taken Yuval's suggestion and made the pager easily subclassable. 
> David> An example of a subclass is:
> 
> David> package Class::DBI::Plugin::Pager::LimitOffset;
> David> use base 'Class::DBI::Plugin::Pager';
> David> sub make_limit { "LIMIT $_[2] OFFSET $_[1]" }
> David> 1;
> 
> 
> David> Again, any suggestions on additional syntaxes would be great. Current 
> David> version is attached, I'll upload to CPAN as soon as I can write a few 
> David> tests. 
> 
> I hate having to subclass just to configure.  Can you make it a
> configurable callback instead?  Use LWP::UserAgent as a model, which
> permits configuration values to be given at ->new time, or later via
> setters and getters, or via subclassing.


The subclasses work by overriding the 'make_limit' method - is this 
what you mean by a callback? That seems to be what LWP::UserAgent is 
doing in its callback methods. 

Or is the point that it would be useful to be able to change syntax 
at runtime? My usage of CDBI is pretty basic, is that something that 
should be included? Maybe with a method in your CDBI subclass:

sub set_pager_syntax {'LimitOffset' }

and the pager checks this first.

Or I could put 'make_limit' into the CDBI subclass, and you can 
override it there?


d.


> 
> -- 
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
> <merlyn@xxxxxxxxxx.xxx> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!




        -- 
        Dr. David R. Baird
Riverside Content Management Systems
http://www.riverside-cms.co.uk

(message missing)

pager
David R. Baird 09:48 on 20 Oct 2004

Re: pager
David R. Baird 13:53 on 20 Oct 2004

Re: pager
David R. Baird 21:00 on 20 Oct 2004

Re: pager
merlyn (Randal L. Schwartz) 02:55 on 21 Oct 2004

Re: pager
David R. Baird 10:46 on 21 Oct 2004

Re: pager
David R. Baird 11:30 on 21 Oct 2004

Re: pager
merlyn (Randal L. Schwartz) 12:10 on 21 Oct 2004

Re: pager
David R. Baird 23:08 on 21 Oct 2004

Re: pager
Cees Hek 00:22 on 22 Oct 2004

Re: pager
Tony Bowden 08:34 on 22 Oct 2004

Re: pager
Emanuele Zeppieri 13:51 on 22 Oct 2004

Re: pager
David R. Baird 14:41 on 22 Oct 2004

Re: pager
David R. Baird 09:20 on 22 Oct 2004

Class::DBI modules not properly loaded under mod_perl ?
Michele Valzelli 10:55 on 22 Oct 2004

Re: pager
Emanuele Zeppieri 12:21 on 22 Oct 2004

Re: pager
David R. Baird 12:52 on 22 Oct 2004

Re: pager
Emanuele Zeppieri 15:33 on 22 Oct 2004

Re: pager
David R. Baird 16:09 on 22 Oct 2004

Re: pager
David R. Baird 23:30 on 07 Nov 2004

RE: pager
Emanuele Zeppieri 03:50 on 14 Nov 2004

Re: pager
Emanuele Zeppieri 13:25 on 22 Oct 2004

Generated at 11:35 on 01 Dec 2004 by mariachi v0.52