I'll vote for the "number of records affected" - provided it won't
create much of a performance hit. This is one thing I've been wanting
for a while and we've just been able to return the correct Informix
"error code" so the driver would understand it.

if there's a genuine error, then throw it, and catch it further up the
stack to alert the view.

>> DAO = 1 row (typically)

not necessarily, esp when foreign key constraints are "programmed in"
or you have complex/multi-faceted "entities" (for us it's both).
Granted large multi-row deletes are for elsewhere, but if, say, an
entity has two child records and that value needs to be confirmed,
then this is where it comes in handy. If you only want a boolan "true"
for sucess then any value greater than 0 will do fine.

it may seem like over engineering (and in most cases it is, just
remember to test for performance) but we do it for certain reasons.

IMHO, returing viod is really not caring what is returned. returning a
number you don't care about seems to be about the same. We're not hung
up on datatypes for returned values like this - numeric and "1" or
sucess could work just as well. Having the flexability to return a
specific number of records deleted or updated is helpful for us - your
milage may vary.

just my 2c
cheers
barry.b


On 5/1/05, John Quarto-vonTivadar <[EMAIL PROTECTED]> wrote:
> maybe it should just return ... nothing?
> 
> Maybe an  error generated during the delete should be dealt with by some
> sort of error handler.  "delete()" should just do what it says: "delete".
> And "dealWithAProblem()" should do just what it says, too
> 
> ----- Original Message -----
> From: "Dave Merrill" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Saturday, April 30, 2005 6:37 PM
> Subject: [CFCDev] What does a DAO delete method return?
> 
> > The number of rows deleted? A string ("127 planets deleted")? Success as a
> > boolean? (What would that mean? True if all requested rows were deleted,
> > else false, even if some were? Don't like this...)
> >
> > I like the string, mostly. It feels a little like interface stuff though,
> > where the number of rows is more the actual action itself. But then every
> > client of it has to do pretty much the same formatting of the string,
> > including pluralizing etc, so I'm liking the string.
> >
> > Comments?
> >
> > Dave Merrill
> >
> >
> >
> >
> > ----------------------------------------------------------
> > You are subscribed to cfcdev. To unsubscribe, send an email to
> > [email protected] with the words 'unsubscribe cfcdev' as the subject of
> > the email.
> >
> > CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
> > (www.cfxhosting.com).
> >
> > An archive of the CFCDev list is available at
> > www.mail-archive.com/[email protected]
> >
> >
> >
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to 
> [email protected] with the words 'unsubscribe cfcdev' as the subject of the 
> email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
> (www.cfxhosting.com).
> 
> An archive of the CFCDev list is available at
> www.mail-archive.com/[email protected]
> 
>


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]


Reply via email to