Tom Chiverton wrote, On 6/8/2007 8:50 AM:
On Friday 08 Jun 2007, Joe Lakey wrote:
To use a Config CFC, would I hard-code the settings variables in the
Config CFC file, instantiate it in application scope in
onApplicationStart(), then call application.config.getDSN() (for
example)?

Yeah.

What would be the benefit of this approach over including a settings file in onApplicationStart() and/or onRequest()?

Including a file has overhead (reading the file from disk), where as accessing an application var. is just reading memory.

You might want to benchmark it though, to see if it really makes much of a difference (after all, if it's included often, it'll be in the disk cache).


Or compiled with the other template, or of course you can check to see if the parameters have been defined, and only include it if not. I wouldn't suspect this to be an issue at all, but I've been known to be wrong on occasion. =)

Sam



You are subscribed to cfcdev. To unsubscribe, please follow the instructions at 
http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at 
www.mail-archive.com/cfcdev@cfczone.org

Reply via email to