Can anyone point me to a tutorial on best practices for scoping variables
within a CFC?  So far I've picked up on these two things:

(1) Use the variables scope for instance variables to prevent access from
outside the object, and
(2) Use the function local scope ("var") to make sure that the objects are
thread safe.

What I'm not entirely clear on is when to use "variables" and when to use
"var".  Is the general rule that if something isn't part of my object's
instance data (ie, stored in the variables scope) that EVERYTHING else be
stored in function local scope?  Can someone explain what kinds of
problems emergy if I were - for example - to do a cfquery inside one of my
methods using a name attribute hadn't already been created as a function
local scoped variable?

Also, are there any concerns/requirements for locking method calls when an
object is stored in a persistent scope?

I know this question has probably been asked numerous times on the list,
but I search through a few pages worth of the archives and didn't turn up
anything.  Any help would be greatly appreciated - thanks :)


-Cliff


----------------------------------------------------------
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).

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


Reply via email to