I didn't realize that the THIS scope was public, I used the developer study guide as my reference and thought it referred to the private scope of each instance of a CFC...

I took an intro Java class and trying to put things to work in CF. Previously I had placed all instance variables in the variables scope, so basically at the top of the CFC I would declare variables.instance.varname for each instance variable...and then I decided to change it to this.variables.instance.varname... now I'm confused, whats the difference?

-Steve


<html><div>--------------------------------------------- <BR>Steven Boynes <BR>580 37th Avenue<BR>San Francisco, CA 94121<BR>(530)574-2129 (Home/Mobile) <BR></div></html>




&gt;From: Sean Corfield &lt;[EMAIL PROTECTED]&gt;
&gt;Reply-To: [EMAIL PROTECTED]
&gt;To: [EMAIL PROTECTED]
&gt;Subject: Re: [CFCDev] concerning this / variables scope in cfc
&gt;Date: Sun, 14 Nov 2004 09:01:45 -0800
&gt;
&gt;On Sun, 14 Nov 2004 17:28:07 +0100, Magnus Wege &lt;[EMAIL PROTECTED]&gt; wrote:
&gt; &gt; In the overview it is mentioned that you shouldn't use the variables scope
&gt; &gt; (&quot;avoid using&quot;).
&gt;
&gt;That's very out-of-date as it refers to bugs in CFMX 6.0 that have
&gt;been fixed for two years (with CFMX 6.1).
&gt;
&gt; &gt; Though Nando is right that the &quot;this&quot; scope is available to
&gt; &gt; the caller which breaks the encapsulation paradigm.
&gt;
&gt;&quot;this&quot; scope is the equivalent to &quot;public&quot; data members - and all the
&gt;literature out there will tell you not to use public data members.
&gt;
&gt;&quot;variables&quot; scope is the equivalent of &quot;protected&quot; data members. If
&gt;your object needs state information, it will use &quot;variables&quot; scope.
&gt;&quot;variables&quot; scope exists for the lifetime of the CFC instance (which
&gt;depends on the scope in which the CFC instance itself is stored).
&gt;
&gt;&quot;var&quot; - not exactly a scope, but you should use it to declare any and
&gt;all variables that should be local to a specific function call. Such
&gt;variables are created fresh for each function call and exist only
&gt;inside that function.
&gt;
&gt; &gt; -----Urspr�ngliche Nachricht-----
&gt;
&gt;And you really need to trim your posts...
&gt;
&gt;[many hundreds of lines deleted]
&gt;--
&gt;Sean A Corfield -- http://www.corfield.org/
&gt;Team Fusebox -- http://www.fusebox.org/
&gt;Breeze Me! -- http://www.corfield.org/breezeme
&gt;Got Gmail? -- I have 1 invite
&gt;
&gt;&quot;If you're not annoying somebody, you're not really alive.&quot;
&gt;-- Margaret Atwood
&gt;----------------------------------------------------------
&gt;You are subscribed to cfcdev. To unsubscribe, send an email
&gt;to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
&gt;in the message of the email.
&gt;
&gt;CFCDev is run by CFCZone (www.cfczone.org) and supported
&gt;by Mindtool, Corporation (www.mindtool.com).
&gt;
&gt;An archive of the CFCDev list is available at [EMAIL PROTECTED]



----------------------------------------------------------
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 [EMAIL PROTECTED]

Reply via email to