Code block one should do a query, and either throw an exception or return
the result.  Code block two should either let program flow pass on (no
exception) or catch the exception and respond accordingly.  The response
might be to let the error propegate to the user, to redirect to an error
page, or to generate a dummy recordset that can be used in place of the
"real" recordset and let program flow pass on.

The first code block shouldn't have enough information about the app's
overall function to be able to make that decision, or you run the risk of
ending up with spaghetti logic.


Barney - Great reason...coding is spaghetti enough somedays - especially when you are dealing with code no of your own.
Why not separate things out for yourself. This makes things easier for yourself and anybody in the future that may have to deal with your "mess".


.pjf

I'm not saying that combining them is necessarily wrong, but doing so it s a
good way to paint yourself in a corner.

Cheers,
barneyb


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

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

Reply via email to