Thanks Barney - I couldn't have said it better... -Rob
"Barney Boisvert" <[EMAIL PROTECTED]>@cfczone.org on 09/25/2003 12:56:50 PM Please respond to [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] To: <[EMAIL PROTECTED]> cc: Subject: RE: [CFCDev] Top Ten Tips for Developing ColdFusion Components The 'this' scope is public. Anyone with a reference to the CFC, has a reference to anything in the 'this' scope. The 'variables' scope, on the other hand, is private. No one can access it, except the methods of the CFC. Both exist for the life of the CFC instance. Usually you want to put instance data in the 'variables' scope, so it's fully encapsulated by the CFC. barneyb > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Hardy Jonck > Sent: Thursday, September 25, 2003 12:52 PM > To: [EMAIL PROTECTED] > Subject: Re: [CFCDev] Top Ten Tips for Developing ColdFusion Components > > > 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. > returntype="shoppingCart" - rather than struct.... From the 6.1 docs is > seems that this would be better? > > 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.... > Why then have a this scope and variables scope? - Is the > variables scope a > place to rather put all private attributes that you do not want accessible > from other components? > > Sincerely > Hardy > > > > > ----- Original Message ----- > From: "Rob Brooks-Bilson" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, September 25, 2003 7:49 PM > Subject: [CFCDev] Top Ten Tips for Developing ColdFusion Components > > > > For all you non blog readers, O'Reilly's Web DevCenter has posted an > > article I wrote called "Top Ten Tips for Developing ColdFusion > Components". > > It's a distillation of material from my book, and some of the great > > discussions that have taken place on this list. Let me know > any feedback > > you all might have. > > > > http://www.oreillynet.com/pub/a/javascript/2003/09/24/coldfusion_tips.html > > -Rob > > > ---------------------------------------------------------- > 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] > ---------------------------------------------------------- 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] ---------------------------------------------------------- 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] ---------------------------------------------------------- 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]
