I suspect that instantiating a CFC into a shared scope isn't much slower than loading a bunch of functions. However, that cost is fairly irrelevant, because it'll only happen once on the first page load. If you're thinking of using CFINVOKE on the CFC directly (rather than on an instance of it), then loading UDFs will be faster for sure.
I'm a big fan of putting CFCs of utility methods in the app scope. CFCs also provide a nice way to keep related functions packaged together. Finally, they ensure that you replace the cached version of ALL the functions at once, preventing you from accidentally forgetting to update one of the cached functions, and causing a bug that is hellish to figure out. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of John Farrar > Sent: Monday, October 13, 2003 8:37 AM > To: [EMAIL PROTECTED] > Subject: Re: [CFCDev] Global UDFs in CFCs > > > Is if faster to put global UDF's in a CFC... or to turn them into > request/session/application scopes? > > The question here is multi-fold, if someone had done the numbers. > 1. Speed to instantiate and run the CFC, compared to a UDF. > 2. Watch the scope so if there are changes the propigate correctly. > 3. Code reuse... and "style"... i.e. - will you create a more > global class? > And have the "global" udf's inherit the class? Instantiating multiple > classes can be more overhead... how does that compare with including more > files for "global" udf functions. > > Note: None of the other functions are "structured"... so if we > are thinking > "functions" on a universal level... they may best serve us by working like > the included functions. I have found no real issue with using an > include and > then turning the functions into global functions. > > John Farrar > > ---------------------------------------------------------- > 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] > ---------------------------------------------------------- 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]
