Re: [CDBI] Updating a record - slight change proposal

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

From: William Ross
Subject: Re: [CDBI] Updating a record - slight change proposal
Date: 14:33 on 07 Sep 2005
On 7 Sep 2005, at 14:41, Hartmaier Alexander wrote:

> Hi!
>
> I already sent a patch to Tony including a test at the time he  
> released
> 0.999.
> The wrote that he will look at it to include in 1.00 but after the
> controversies on the list Tony never replied about it.

Looking at your patch, it works in the same way as Kate's proposed  
change. There are at least two problems with this:

* not all objects will stringify to the value that is stored in the  
database. To be sure that you are comparing the values that would be  
stored, you would have to use Class::DBI's deflation mechanism to  
make the comparison. That's possible but it won't be very nice, and  
it might be awkward for people whose deflation methods have side  
effects. Which they probably shouldn't.

* lazy loading means that very often the existing value of the column  
you are setting has not been retrieved when you come to supply a new  
value, so no comparison is possible unless you retrieve that column  
first.

Both of these problems would only lead to false negatives - ie you  
would wrongly find that a column had changed - so perhaps they don't  
matter that much, but they create fuzziness and irregularity:  
sometimes this will happen, sometimes that. The present setup is  
arguably less efficient, but much cleaner and easier to work with.

I believe that it's this kind of complication that made Tony decide  
to refactor the whole object/column/attribute model rather than  
trying to stretch the existing code any further. I don't know whether  
we will ever see that code.

best

will


_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

RE: [CDBI] Updating a record - slight change proposal
Hartmaier Alexander 13:41 on 07 Sep 2005

Re: [CDBI] Updating a record - slight change proposal
William Ross 14:33 on 07 Sep 2005

Generated at 10:29 on 10 Oct 2005 by mariachi v0.52