RE: Class::DBI::Loader and accessors

[prev] [thread] [next] [Date index for 2005/03/24]

From: Peter Speltz
Subject: RE: Class::DBI::Loader and accessors
Date: 00:04 on 24 Mar 2005
--- Zhuang Li <zli@xxxxxxxxxx.xxx> wrote:
> Hi, Tony, thank you for your reply. I've learnt a lot from reading your
> postings to the list but haven't been able to check as often lately.
> 
> Anyway, 'retrieve_all' is just a special form of 'search' to me. It's
> easier to remember and to do this way:
> 
> 	@cds = Music::CD->search(year => 1990, { order_by => 'artist'
> });
> And 	@cds = Music::CD->retrieve_all({ order_by => 'artist' });
> 
> than this way:
> 
> 	@cds = Music::CD->search(year => 1990, { order_by => 'artist'
> });
> But	use base 'Class::DBI';
>       use Class::DBI::Plugin::RetrieveAll;
> 
>       @cds = Music::CD->retrieve_all_sorted_by("artist");
> 
> I'm not sure how useful or necessary to have a default 'sorted_by' for
> 'retrieve_all' (i.e may have to check elsewhere to find out what's
> default 'sorted_by'). 
> 

I like both for retrieve all. The first, (having a order_by arg ) is very
convenient, easy to remember, and you can override the default set by the
plugin. The default is nice if other classes want to list you  or make a select
box out of you or something. They don't have to know anything about you to
provide the user with a logically ordered list. 

Regards,


pjs


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

(message missing)

Class::DBI::Loader and accessors
Sean Davis 21:10 on 15 Mar 2005

Re: Class::DBI::Loader and accessors
Kingsley Kerce 21:29 on 15 Mar 2005

Re: Class::DBI::Loader and accessors
Perrin Harkins 21:51 on 15 Mar 2005

Re: Class::DBI::Loader and accessors
Kingsley Kerce 22:28 on 15 Mar 2005

Re: Class::DBI::Loader and accessors
Kingsley Kerce 17:51 on 16 Mar 2005

Re: Class::DBI::Loader and accessors
Perrin Harkins 19:22 on 17 Mar 2005

RE: Class::DBI::Loader and accessors
Zhuang Li 18:48 on 17 Mar 2005

RE: Class::DBI::Loader and accessors
Kingsley Kerce 19:07 on 17 Mar 2005

RE: Class::DBI::Loader and accessors
Zhuang Li 20:02 on 17 Mar 2005

RE: Class::DBI::Loader and accessors
Kingsley Kerce 21:02 on 17 Mar 2005

Re: Class::DBI::Loader and accessors
Tony Bowden 23:16 on 17 Mar 2005

RE: Class::DBI::Loader and accessors
Zhuang Li 21:43 on 17 Mar 2005

Can't call id() as a class method
Tom Gazzini 22:44 on 17 Mar 2005

Re: Can't call id() as a class method
Perrin Harkins 22:52 on 17 Mar 2005

Re: Can't call id() as a class method
Tony Bowden 23:15 on 17 Mar 2005

RE: Class::DBI::Loader and accessors
Zhuang Li 21:54 on 23 Mar 2005

Re: Class::DBI::Loader and accessors
Tim Bunce 22:26 on 23 Mar 2005

Re: Class::DBI::Loader and accessors
Tony Bowden 23:00 on 23 Mar 2005

Re: Class::DBI::Loader and accessors
Tony Bowden 23:34 on 23 Mar 2005

RE: Class::DBI::Loader and accessors
Zhuang Li 23:07 on 23 Mar 2005

RE: Class::DBI::Loader and accessors
Zhuang Li 23:50 on 23 Mar 2005

RE: Class::DBI::Loader and accessors
Peter Speltz 00:04 on 24 Mar 2005

Generated at 15:09 on 27 Mar 2005 by mariachi v0.52