Well, at some point you'll need to put something in a persistent memory
scope if you want it to stick around from request to request (assuming you
don't want to read it off the file system/network every time).  My initial
suggestion about the server scope was, in fact, to use it internal to the
CFC.  So, something like:

<cffunction name="init">
<cfif NOT structKeyExists(server,"myCFCConfig")>
DO CONFIG
</cfif>
<cfset variables.config = server.myCFCConfig>
</cffunction>

Again, this is not really a best practice, but if you really want it to be
"inside" your CFC you'll need to do something along those lines.


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Bryan F. Hogan
> Sent: Thursday, October 16, 2003 10:08 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] Initialize only once
>
>
> This would also work, but I'm looking for a way to do it within
> the CFC and not rely on any outside files or scopes.
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Nathan Dintenfass
> Sent: Thursday, October 16, 2003 10:06 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] Initialize only once
>
>
> You could use the server scope -- it still breaks encapsulation to some
> extent, so it's not really a "best practice", but since you KNOW
> the server
> scope will always exist (unlike Application and Session scope) it
> strikes me
> as less of a violation of encapsulation.
>
> Alternatively, if you want to make things cleaner you could make
> a separate
> component that hold configuration info and cache that instance,
> then feed it
> to your component when you init().
>
>
> ----------------------------------------------------------
> 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]

Reply via email to