Oops....I should have read the other responses, and avoid repeating what Nathan had to say. I have always found he can say it in a much more intelligent manner than myself. Ignore my post, and refer to his =)
Hope I didn't confuse anything? Justin -----Original Message----- From: Matthew Walker [mailto:[EMAIL PROTECTED] Sent: Thursday, July 31, 2003 4:50 PM To: [EMAIL PROTECTED] Subject: [CFCDev] envronment variables and CFCs Hiya, We have a bunch of fairly amateurishly written CFCs (yes guilty) that access a few global environment variables in the request scope (say for example datasource name and a few similar). Now I'm trying to address this and finding I have a few options.... 0) Access environment variables in the request scope directly from the CFC method. This is the technique I'm undoing, hence option 0. 1) pass each environment variable into each CFC method as required. I think this is an ugly inelegant solution although conceptually the simplest. 2) Create an object containing all the environment variables with accessor and mutator methods as appropriate and pass in this object when initializing any CFC. This is the option I'm in favour of. 3) Have each CFC extend a CFC that can access these environment variables. I am uncomfortable with this as it seems like the name space of the CFC is going to be rather crowded with methods -- there'd be getSomethingVerySpecificToThisObject() alongside getSomeAppSetting() which seems disorganized. Other options? No doubt. This must be a very common, very fundamental problem. What do other folks do? ---------------------------------------------------------- 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). ---------------------------------------------------------- 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).
