Re: Stolen Ideas

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

From: Tony Bowden
Subject: Re: Stolen Ideas
Date: 22:37 on 10 Aug 2004
On Tue, Aug 10, 2004 at 06:23:15PM -0400, Perrin Harkins wrote:
> It's mostly not an issue for Class::DBI, until you get to polymorphism. 
> Say that a person has_many MediaDiscs.  When you load them, and then
> want to work with one, how does it get the right class for each one? 

Yeah - I've faced that problem quite a lot - it's a fairly standard
thing in ecommerce applications where the shop sells more than one type
of thing. I've never really found a good solution.

> Right now people do this with triggers or custom constructors.

That's what I've tended towards recently. The last one we did was
attachments on email. A message has_many attachments. One of the columns
of the attachment table is the content-type. We just used a select
trigger to call Attachment::Factory->transform(shift) which then used
that content_type to rebless into the relevant subclass. 

It would be nice to have a way to do this more simply, but I've never
come up with a good way.

> Results of search() operations would be cached.  I once thought this was
> not necessary, but now I think I was wrong about that.

What's made you change your mind.

> The delete_from is useful because it implies the value of the
> relationship column:
> $cd->delete_from_tracks( title => 'Shake It Up' );
> In this case, title is not a unique identifier for tracks, but the

  $cd->tracks(title => 'Shake It Up')->delete_all;

No new syntax required.

> > SELECT DISTINCT(__ESSENTIAL__)
> Well, many collections of things in databases have no implicit order to
> them, so using an array is not really representing what's in the
> database.  In a larger sense, I was thinking more of how Tangram and
> Hibernate let you load a collection of objects, modify which objects are
> in the collection, and then save the collection back to the database,
> but I'm not sure how valuable that really is.

I think this is what we talked about at oscon last year? I've still to
see a need for this. Good examples can always convince me though :)

Tony

(message missing)

Stolen Ideas
Tony Bowden 18:58 on 10 Aug 2004

Re: Stolen Ideas
ed-cdbi 19:03 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 19:06 on 10 Aug 2004

Re: Stolen Ideas
ed-cdbi 19:08 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 19:11 on 10 Aug 2004

Re: Stolen Ideas
ed-cdbi 19:19 on 10 Aug 2004

RE: Stolen Ideas
Thomas, Mark - BLS CTR 19:11 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 19:27 on 10 Aug 2004

Re: Stolen Ideas
Nelson C. T. Ferraz 15:14 on 12 Aug 2004

Re: Stolen Ideas
Scott McWhirter 19:18 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 19:28 on 10 Aug 2004

Re: Stolen Ideas
Scott McWhirter 20:42 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 21:08 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 21:33 on 10 Aug 2004

Re: Stolen Ideas
Scott McWhirter 22:58 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 23:23 on 10 Aug 2004

Re: Stolen Ideas
Gregory P. Smith 19:55 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 20:02 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 21:47 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 22:23 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 22:37 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 22:57 on 10 Aug 2004

Re: Stolen Ideas
Yuval Kogman 15:39 on 11 Aug 2004

Re: Stolen Ideas
Tony Bowden 22:02 on 10 Aug 2004

Re: Stolen Ideas
ed-cdbi 22:11 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 22:25 on 10 Aug 2004

Re: Stolen Ideas
Tim Bunce 08:53 on 24 Aug 2004

Re: Stolen Ideas
Perrin Harkins 22:16 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 22:42 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 22:16 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 23:18 on 10 Aug 2004

Re: Stolen Ideas
Scott McWhirter 23:48 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 00:22 on 11 Aug 2004

Re: Stolen Ideas
Perrin Harkins 03:45 on 11 Aug 2004

Re: Stolen Ideas
Tony Bowden 08:36 on 11 Aug 2004

Re: Stolen Ideas
Aaron Trevena 19:05 on 13 Aug 2004

Re: Stolen Ideas
Aaron Trevena 17:13 on 15 Aug 2004

Re: Stolen Ideas
Dan Friedman 04:47 on 11 Aug 2004

Re: Stolen Ideas
Tony Bowden 08:39 on 11 Aug 2004

Re: Stolen Ideas
Branislav Zahradnik 15:21 on 11 Aug 2004

RE: Stolen Ideas
Thomas, Mark - BLS CTR 19:13 on 13 Aug 2004

Re: Stolen Ideas
Tony Bowden 23:16 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 23:42 on 10 Aug 2004

Re: Stolen Ideas
Tim Bunce 08:48 on 24 Aug 2004

Re: Stolen Ideas
Tony Bowden 21:57 on 11 Aug 2004

Re: Stolen Ideas
Simon Cozens 09:03 on 24 Aug 2004

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