yep, bad practice, should be avoided at all costs. Even though your CFCs
are just function libraries, it's still a bad idea to tie them to some
external scope (as you may want to use them someday where those request
variables don't exist).

A quick hack would be to pass the entire scope as an argument... not a
great idea but better than referencing a scope directly from within a
CFC.

-Dave Ross

>>> [EMAIL PROTECTED] 10/27/05 7:36 AM >>>
Hi all,

I understand that CFCs shouldn't rely on external variables and that
instead them should be passed to methods as arguments and I try to do
that as much as I can ...

But sometimes I feel pretty convenient to use request variables inside
CFCs, especially when I have to pass in some variables (e.g. a format
string for the dateFormat function) that I didn't account for at the
beginning ...

Is really a bad practice that should be avoided at all costs? :-)

BTW, for now most of my CFCs are just functions libraries (e.g. no
instance data, except the datasource, etc.), I dind't get into full
OOP yet.

Thanks.


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of
the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]




-----------------------------------------
CONFIDENTIALITY NOTICE: This email and any attachments may contain
confidential information that is protected by law and is for the sole
use of the individuals or entities to which it is addressed. If you are
not the intended recipient, please notify the sender by replying to
this email and destroying all copies of the communication and
attachments. Further use, disclosure, copying, distribution of, or
reliance upon the contents of this email and attachments is strictly
prohibited. To contact Albany Medical Center, or for a copy of our
privacy practices, please visit us on the Internet at www.amc.edu.



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to