Thanks Barney, you have been most helpful. 

A great majority of your CFCs must be using the ErrorSet object. And lets
say in one request you needed to validate 10 different CFCs, each one would
create an Errorset object. If instead you created one main ErrorSet object
in your controller and then passed into each CFC, do you there would be a
significant performance improvement? Is that bad style?

Cheers,

Baz


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Barney Boisvert
Sent: Sunday, October 30, 2005 6:25 PM
To: [email protected]
Subject: Re: [CFCDev] Message Handling

Yeah, it creates and returns an ErrorSet object.  Validate creates an
ErrorSet, populates it as needed, and then stores it in the object's
instance state for later recall with getValidationErrors.  It also
returns it, since that's usually what the calling code wants.  Each
time validate is called and any of the instance data has changed, it
creates a new set and populates it.  Obviously if no state has
changed, there's no need to do the whole validation routine (with a
new notable exceptions, such as uniqueness checks).

function validate() {
  var errorSet = new ErrorSet();
  // check field X
  // check field Y
  variables.errorSet = errorSet;
  return errorSet;
}

cheers,
barneyb

On 10/30/05, Scratch <[EMAIL PROTECTED]> wrote:
>
> Hey Barney,
>
> In your example does Customer.Validate() return an object? If so, was that
> object created inside the Validate() method?
>
> Baz
>

--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 100 invites.


----------------------------------------------------------
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