Plus you get to chain together the initialization of the cfc and the assignment of the cfc. Just be sure that your INIT method has <cfreturn this> at the end of the method.
----------------------------------- Gerry Gurevich Application Development NIEHS ITSS Contractor Lockheed Martin Information Technology 919-361-5444 ext 311 -----Original Message----- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 2:32 PM To: [email protected] Subject: RE: [CFCDev] Init Methods on CFCs OOP new guy here, but I would say the benefits of having an INIT method even on small CFCs would be: 1. Get in the habit of having it 2. If you needed to have code in the INIT method in the future, all the calls to it would already be in place. My 2 cents. ...................... Ben Nadel www.bennadel.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joshua Scott Sent: Monday, May 08, 2006 2:14 PM To: [email protected] Subject: [CFCDev] Init Methods on CFCs All, I have a two function utility cfc that I use to create sortable columns for record displays. Always before I have called <cfset var SortMaster = CreateObject("Component", "CAMSymphony.model.util.SortMaster") /> Many of the framework and OO oriented CFC patterns that I have seen actually have a init() method and are created like this: <cfset var SortMaster = CreateObject("Component", "CAMSymphony.model.util.SortMaster").init() /> I understand the purpose in the frameworks for using this pattern, but in a simple cfc is there a purpose for this? Any advise would be great. - JS ------------------------------------------------ Joshua Scott Resonant Media Technologies, LLC. http://www.resonantmedia.com | http://ponderings.wordpress.com "It is impossible to get out of a problem by using the same type of thinking that it took to get into the problem." -- Albert Einstein ---------------------------------------------------------- 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] ---------------------------------------------------------- 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] ---------------------------------------------------------- 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]
