Re: Copying a Class::Accessor class to a CDBI class (CDBI::Plugin::Temp)

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

From: merlyn (Randal L. Schwartz)
Subject: Re: Copying a Class::Accessor class to a CDBI class (CDBI::Plugin::Temp)
Date: 12:11 on 25 May 2005
>>>>> "Tony" == Tony Bowden <tony-cdbitalk@xxxxx.xxx> writes:

Tony> The only thing that's likely to be a problem is what happens to that
Tony> first record. I'm assuming that nothing breaks currently when that
Tony> object disappears, but that' sthe sort of thing that might change later,
Tony> which is why it would be a good idea to have an explicit test in the
Tony> baseline for this so that if anything does break it later we'll know.

Tony, if you add a "realized" field to your object, which is set only
when the object in memory maps to a "real" database object, you could
guarantee that the right thing happens.

For example, you could ensure that ->update (or autoupdate) is a no-op
for non-realized row objects.

        -- 
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxx.xxx> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Re: Copying a Class::Accessor class to a CDBI class (CDBI::Plugin::Temp)
merlyn (Randal L. Schwartz) 12:11 on 25 May 2005

Generated at 15:51 on 25 May 2005 by mariachi v0.52