> "Do not directly refer to external variables (i.e.: 
> session/application
> variables) inside a CFC. When in doubt, preserve 
> encapsulation. The one exception is when building facades for 
> web services/flash remoting. This means, for instance, 
> passing in the dsn instead of referring to application.dsn 
> when doing database queries."
> 
> How would you refer to a session or application variable 
> going by this guideline? 
> 

You don't. If the CFC needs to work with the variables, you can pass them in
via a method. If you are using App variables for contants (DSN, etc), you
can use a simular technique. Store your variables in an XML file and have
the CFC read it (the main application can read it as well). Or use an INI
file. Or use what I use - another CFC. I'll use a CFC w/ the same name as my
application. It will have one main method, getSettings(), that returns a
structure of application settings.

===========================================================================
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc (www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words '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