In the online article first point:
<cfcomponent displayname="shoppingCart">
<cffunction name="init" access="public" output="no" returntype="struct">
<cfargument name="cartID" type="UUID" required="yes">
...
</cfcomponent>
Should the returntype not rather be "shoppingCart" ie.
Yes, that would probably be better practice (I didn't notice that when I first read the article!).
Why would you store the cartID in the variables scope and not the this
scope? If I understand correctly the variables scope only lives for the
duration of the request/response event - but I seem to be wrong as the
article states that the variables scope lives as long as the object does....
'var' scope only lives for the duration of the function invocation, 'variables' scope lives for the duration of the CFC instance itself and hold non-public instance data, 'this' scope is, effectively, the public equivalent of 'variables' scope.
Is the variables scope a
place to rather put all private attributes that you do not want accessible
from other components?
Yup.
Sean A Corfield -- http://www.corfield.org/blog/
"If you're not annoying somebody, you're not really alive." -- Margaret Atwood
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word '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]
