In that scenario, you'd say 9 ErrorSet instantiations, but you'd sacrifice the encapsulation of the object. In my setup, every object knows whether it's valid or not, and it uses the ErrorSet object to do it. No object means the state isn't known, and needs to be checked, a zero-element object means there are no errors (that is, it's valid), and a one-plus-element object indicates there are errors that must be resolved.
By passing in your ErrorSet object, you force the object to keep track of that in a different way, and probably force it to dynamically compute the ErrorSet's contents every time it's needed, rather than only recomputing when a value changes. Passing a single ErrorSet will be faster, but probably not measurably faster, and to me, it's not worth the ramifications. At least not until it's been proven an issue with load testing and profiling. And even then, theres probably better ways to save that millisecond or two. cheers, barneyb On 10/30/05, Scratch <[EMAIL PROTECTED]> wrote: > > 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 > -- 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]
