I find that for CFCs doing database work I am typically caching an instance
of the CFC in the application (or sometimes session scope) as appropriate.
Thus, when I instantiate I pass necessary global variables into the CFC, so
I might have something like:

application.myCFC =
createObject("component","myCFC").init(application.globals.dsn);

or even:

createObject("component","myCFC").init(argumentCollection=application.global
s);

Which I use depends on how many global variables I have and how many that
CFC needs to use.

 - Nathan






> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of [EMAIL PROTECTED]
> Sent: Friday, September 26, 2003 7:45 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] Top Ten Tips for Developing ColdFusion Components
>
>
> with this in mind, what's a 'best' practise for getting global
> config data into a CFC?  For example, a datasource name.  Does
> one include an app_globals styled file into the cfc?
>
> Doug
>

----------------------------------------------------------
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]

Reply via email to