I have validate() return boolean, and then have a separate getValidationErrors() method that can be used to retrieve an array of structs, one struct per error. You could use an array of error CFCs, but since errors are pure state, I don't see the real benefit of using a CFC over just a struct.
With this usage, it would be more proper to name your validate() method isValid() instead. On Mon, 3 Jan 2005 16:02:15 -0600, Dawson, Michael <[EMAIL PROTECTED]> wrote: > One more quick question... > > Should validate() return something (string, array, CFC, whatever)? > > Or, should validate() return void and then require me to call > "hasErrors()"? > > What is the norm, if there is one? > > I guess if validate() returns an error-handler CFC, I can call its > hasErrors() method. That would seem to be the best way to reuse code > throughout my app. > > Thanks > M!ke -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 9 invites. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189185 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

