Re: Annouce: DBIx::Class, a.k.a "taking the easy way out"

[prev] [thread] [next] [Date index for 2005/07/26]

From: Tony Bowden
Subject: Re: Annouce: DBIx::Class, a.k.a "taking the easy way out"
Date: 22:39 on 26 Jul 2005
On Tue, Jul 26, 2005 at 11:11:46PM +0100, Matt S Trout wrote:
> Plus, what if you want to plug-and-play with layers of search generation?
> e.g.
> 
> My::Search does the WHERE condition
> My::OrderBy adds the ORDER BY
> My::Limit add the LIMIT clause
> 
> How can you arrange to drop in and replace any of the three of these without
> something, somewhere, having explicit knowledge of what to replace where?

  my $searcher = $self->search_class->new;
  foreach my $plugin (@plugins) {
    $plugin->manipulate($searcher);
  }
  my @results = $searcher->run;

No inheritance necessary at all, never mind MI. (For convenience most
plugins will probably inhertit from a base, just so they can rely on
certain default behaviour, but duck typing is sufficient really.)

All the plugins need to know is what they can do with the searcher,
based on on what's in its API. 

Tony

(message missing)

Re: Annouce: DBIx::Class, a.k.a "taking the easy way out"
Tony Bowden 22:39 on 26 Jul 2005

Delegation vs Hooks (was: Annouce: DBIx::Class, a.k.a "taking the easy way out")
=?ISO-8859-1?Q?Ask_Bj=F8rn_Hansen?= 23:27 on 26 Jul 2005

Generated at 16:37 on 28 Jul 2005 by mariachi v0.52