It's applicable either way, because whether you build a struct and return it, or just return on first error, you still have all your validation logic and your text messages intermixed in a function. I usually don't bother to make the distinction, but it's something to consider, especially if it's not going to be a backend coder who needs to have some access to those error messages. The best solution is an externalized string set, but that's got it's own headaches. Depends on the environment you're working in.
barneyb > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Raymond Camden > Sent: Monday, October 06, 2003 12:11 PM > To: [EMAIL PROTECTED] > Subject: RE: [CFCDev] Data validation > > > Ah, I suppose that makes some sense if your validate returns complex > messages. Generally my validate methods return one error, the first that > is found, so it would be a simple thing that can then be thrown back to > the user. Now, I do take exception with > > "> textual error messages to return to the calling code. That > > also keeps the messages (which are really part of the > > presentation layer) separate from the logic." > > I assume you mean this if your validate is returning a set of messages? > > ======================================================================== > === > Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc > (www.mindseye.com) > Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia) > > Email : [EMAIL PROTECTED] > Blog : www.camdenfamily.com/morpheus/blog > Yahoo IM : morpheus > > "My ally is the Force, and a powerful ally it is." - Yoda > ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word '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]