Re: Stolen Ideas

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

From: Perrin Harkins
Subject: Re: Stolen Ideas
Date: 22:23 on 10 Aug 2004
On Tue, 2004-08-10 at 17:47, Tony Bowden wrote:
>     * Built-in support for mapping of inheritance.
> 
> I'm not entirely sure what this means.

Imagine classes CD and DVD which inherit from MediaDisc.  They share
some properties, but not all.  There are three common ways to map them
to database tables.  Martin Fowler's description is pretty good.  It's
on-line here:
http://www.informit.com/articles/article.asp?p=30661&seqNum=4

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? 
Right now people do this with triggers or custom constructors.

This may not be something you want to deal with, since as you say it is
about objects-to-databases rather than databases-to-objects.  I think
it's a common thing to want from an O/R tool though.

>     * Support for flexible object and query caching. (I plan to work on this.)
> 
> We've discussed the object caching, but what extra should we have on
> query caching?

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

>     * Built-in support for fetching a graph of related objects in one
>       SQL statement (like the recent question on the mailing list about
>       fetching an object and it's might_have relation in one shot).
> 
> Again, I think the hard part here is inteface rather than
> implementation. Suggestions welcome!

Okay, I'll think about that.  When you look at the other tools, keep an
eye out for how they specify this.

>     * More extensive support for collections, like delete_from_* (as
>     * opposed to add_to_*) 
> 
> There are a couple of patches outstanding for this. delete_from_* only
> really becomes useful when you've many-to-many (feel free to convince me
> otherwise if this isn't actually true), but I need to think through the
> implications of it more for complex joins.

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
automatic addition of cd_id => $cd makes it unique.

> 		* and mapping of related objects to sets, rather than just arrays.
> 
> Again, I assume this is really to do with many-many and other complex
> joins? If it's the problem I've had before, it's really just a matter of
> changing the SQL generated from a simple SELECT __ESSENTIAL__ to a 
> SELECT DISTINCT(__ESSENTIAL__), or am I missing the point?

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.

- Perrin

(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