I use 'this' for stuff that I want to have as public data. Public data is stuff that can be modified from outside the component and tends to break encapsulation, so it is very rare that I use it.
In fact, I don't remember the last time I wrote a component that used the 'this' scope because it encourages lazy shortcuts like directly modifying the data members of the component without going through a method.
Spike
Mark M wrote:
Spike -
Noticed here -
<cffunction name="init" access="public" output="false" returntype="boolean" hint="Initializes the cart if it has not been initialized yet">
<cfif not isDefined('instance')>
<cfset instance = structNew()>
<cfset instance.aItems = arrayNew(1)>
<cfset instance.timestamp = Now()>
<cfset instance.IDs = "">
</cfif>
<cfreturn true>
</cffunction>
You didn't use the 'this' syntax anywhere.
Was there a particular reason for this?
Mark
-----------------------------------
[EMAIL PROTECTED] ICQ: 3094740
Safe From Bees
[www.safefrombees.com]
--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
