[Dbix-class] faking ResultSets

Richard Jolly Richard.Jolly at bbc.co.uk
Thu Jan 26 12:42:38 CET 2006


> From: dbix-class-bounces at lists.rawmode.org 
> [mailto:dbix-class-bounces at lists.rawmode.org] On Behalf Of 
> David Jack Olrik
> Sent: 26 January 2006 08:03
> 
> On 25/01/2006, at 16.00, Richard Jolly wrote:
> 
> > We have a growing mismatch in our code between methods that return 
> > ResultSet objects and those that return an array/arrayref 
> > of objects.
> > This is in a Catalyst model layer.
> >
> > Is there a common solution to this problem? How do people 
> > keep their 
> > api consistent?
> 
> What about http://search.cpan.org/~mramberg/DBIx-Class-AlwaysRS-0.01/

That's nice, particularly for the TT problem. But it doesn't quite
address my original issue:

sub foo {
  ...
  return Class->search(...);
}

sub bar {
  ... do some non-DBIC stuff ...
  return wantarray ? @stuff : \@stuff;
}

Consistency is good. 

Richard

> --
> Best regards,
> David Jack Olrik <david at olrik.dk>             http://david.olrik.dk

http://www.bbc.co.uk/

This e-mail (and any attachments) is confidential and may contain
personal views which are not the views of the BBC unless specifically
stated.
If you have received it in error, please delete it from your system. 
Do not use, copy or disclose the information in any way nor act in
reliance on it and notify the sender immediately. Please note that the
BBC monitors e-mails sent or received. 
Further communication will signify your consent to this.



More information about the Dbix-class mailing list