Re: Need help with finding solution to CDBI bug

[prev] [thread] [next] [Date index for 2004/06/23]

From: Charles Bailey
Subject: Re: Need help with finding solution to CDBI bug
Date: 22:12 on 23 Jun 2004
--On Wednesday, June 23, 2004 9:53 PM +0100 Tim Bunce <Tim.Bunce@xxxxx.xxx> 
wrote:

>
> Summary:
>
> The id() method is meant to be the way to get the primary key of

I think this may be the crux of our divergent thinking.  I've been thinking 
about the "primary key" from the perspective of CDBI (i.e. it's the 
object's attributes for the columns which constitute the primary key; if 
those columns have CDBI relationships attached, then the primary key 
includes objects) rather than the perspective of the database table (i.e. 
it's the values in the actual DB table, stripped of the CDBI abstraction).

I can see places where one would want either of the above; my sense is that 
a CDBI object method id() should take the object-level view, with an 
analogous flat_id() or string_id() returning the db-level view.  Some of 
that is undoubtedly colored by habit: our principal CDBI application here 
uses objects as PK values, and $obj->id() is the straightforward way to get 
those values and then operate on them.

> an object. Right now what you get back *may not* be the primary key
> due to the effect of Stringify. The change fixes that.

It seems like an indirect fix.  $obj->id() always returns the primary key, 
regardless of what's been done with Stringify.  "$obj" may or may not 
return the primary key, depending on what the class has done with 
Stringify.  The change you've made just lets other code (in this case, the 
a DBD driver) that assumes "$obj" returns the primary key get away with it.

That's why I've suggested the fix would be better sited in 
DBIx::ContextualFetch - nothing from that point down needs to know about 
CDBI's object model, while code above it may actually want to work with the 
objects in the PK.

If the consensus is that id() really ought to refer to the underlying DB's 
notion of the primary key, would it then be reasonable to add a method 
called something like object_id(), doing what id() does now, or should we 
just let each person who uses that functionality roll their own?


--
Regards,
Charles Bailey  < bailey _at_ newman _dot_ upenn _dot_ edu >
Newman Center at the University of Pennsylvania

(message missing)

Need help with finding solution to CDBI bug
William McKee 11:40 on 19 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 13:19 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 14:06 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 15:14 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 15:23 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 17:07 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 15:30 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 15:37 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 16:12 on 25 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 16:33 on 25 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 21:47 on 25 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 08:34 on 26 Jun 2004

Re: Need help with finding solution to CDBI bug
Takes Tea at Half Past Three 17:06 on 25 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 22:13 on 25 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 00:10 on 26 Jun 2004

RE: Need help with finding solution to CDBI bug
robert_creager 04:34 on 03 Jul 2004

Re: Need help with finding solution to CDBI bug
William McKee 17:17 on 05 Jul 2004

Re: Need help with finding solution to CDBI bug
Robert Creager 20:57 on 05 Jul 2004

Re: Need help with finding solution to CDBI bug
Robert Creager 00:22 on 06 Jul 2004

Re: Need help with finding solution to CDBI bug
William McKee 12:50 on 06 Jul 2004

Re: Need help with finding solution to CDBI bug
William McKee 17:05 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 17:18 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 17:41 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 18:04 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 19:20 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 20:16 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 07:34 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 14:25 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 20:03 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 22:44 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 15:16 on 24 Oct 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 22:15 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 12:33 on 23 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 17:17 on 23 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 11:38 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
merlyn (Randal L. Schwartz) 16:10 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 13:19 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 22:04 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 12:43 on 23 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 19:52 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 19:56 on 23 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 12:48 on 23 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 22:12 on 23 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 23:30 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 07:08 on 24 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 13:53 on 24 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 14:51 on 24 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 07:12 on 24 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 13:50 on 24 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 14:55 on 24 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 16:04 on 27 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 17:53 on 27 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 12:58 on 06 Jul 2004

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