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

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

From: Tony Bowden
Subject: Re: Annouce: DBIx::Class, a.k.a "taking the easy way out"
Date: 22:11 on 25 Jul 2005
On Mon, Jul 25, 2005 at 03:03:40PM -0700, Michael G Schwern wrote:
> > Although I pretty much agree with you in theory, pretty much the entire
> > central concept of Class::DBI is the dynamic generation of methods in
> > your namespace ....
> You can blame me for that one, and I still have not repented on that design
> choice.

I don't think the design needs repented for. It's really bad from all
sorts of theoretical perspectives, but in practice it works really well.
(Apart from some bad method name choices that interfere with people
being able to have columns of those names, but they were mostly mine
rather than yours...)

> Anyhow, it appears DBIx::Class does the same thing...?  Are we talking about
> the column accessors (which DBIx::Class appears to use) or the idea of 
> mixin plugins?

I was talking about column accessors being injected directly into the
namespace.

Mixin plugins I'm not a big fan of. They're often a sign of a poor
design. They have their place, and they're really useful (We're heading
towards 100 Class::DBI plugins on CPAN, and most of them work like
that), but I'd prefer to provide better hooks for people to do things
like this in a less nasty way, and allow for proper inheritance etc of
the plugins (e.g. you want to change how has_many works: just inherit
from Class::DBI::Relationship::HasMany, override a small piece, and
then plug it in via add_relationship_type(). Much cleaner all around.

I've gradually been refactoring Class::DBI to make it much easier to do
this with almost everything.

There are some core concepts that are very difficult here (like each
class *being* a database connection, rather than just having one), and
there's still not an ideal solution. But there are enough workarounds
for people to be able to do what they need, and hopefully as everything
gradually gets cleaned up, the solution will eventually become
blindingly obvious.

Tony


(message missing)

Re: Annouce: DBIx::Class, a.k.a "taking the easy way out"
Tony Bowden 22:11 on 25 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