This all goes back to the "contract" of what is agreed upon
by the client and the service. If my client agrees that the service will
throw an exception, the contract states that the client will check for that
exception.
Take this function call, for example:
#parseDateTime("M!ke")#
ColdFusion throws an error. CF does "not" return
"M!ke" as the date nor does it return "" or null.
In this case, I can test for a valid date using
isDate("M!ke") or I can wrap it in a try/catch block. However, I can't
always be certain that I'm passing a valid date/time string to the
parseDateTime() function.
I can't imagine creating a database-related function that
returns "0" or "" if the database server was unavailable. That is just
flat-out lying to the client code.
M!ke
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mihai Manuta
Sent: Monday, October 24, 2005 7:14 AM
To: [email protected]
Subject: Re: [CFCDev] CFC return types
Given the most used practice in the OOP is to return null (or a NullObject) when you don't have anything to return (and you don't have an error, there is just nothing there to give back...) it seems only reasonable for other developers to expect you to do that.
Just my 2c...
mihaimm
On Sun, 2005-10-23 at 23:52 -0700, Barney Boisvert wrote:
asking a person to give you a reference to their non-existant spouse----------------------------------------------------------
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).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
