I think the consistency argument is the best. There is not reason that I have seen NOT to do it and it makes it consistent with OO programming and gives expandability for later.
- JS -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Ross Sent: Tuesday, May 09, 2006 9:38 AM To: [email protected] Subject: Re: [CFCDev] Init Methods on CFCs Which is why it's better from a maintainability perspective to wire up your CFCs to a configuration service (whom they can then ask "configuration" questions). Forcing the construction of an object to be dependent on the type of configuration it needs is a very brittle architecture IMO. At the bare minimum always pass in a config object/bean/struct/whatever to init(). I prefer a no-argument init() and a setConfigService(service) method. Keep in mind that this architecture also supports runtime changing of configuration (without re-construction) - as long as your objects always ask the ConfigService and don't store any data locally. Or I could be crazy... -Dave Ross >>> [EMAIL PROTECTED] 05/09/06 9:50 AM >>> Changes are that if "tomorrow" it needs to require an initialization the initialization will also require some arguments. I do not see how the change with not already having the Init() is any different vs already having it, still means a mass find/replace and so long as the coding is consistant either one would be simpe enough to change IMHO. On 5/8/06, Nando <[EMAIL PROTECTED]> wrote: > > > "Tomorrow", you might decide to change SortMaster in a way that requires > initialization. Assuming your app is live, you might have a delicate dance > deploying the change without breaking your app. And you'll need to touch > much more code than you would if you already had the init() in place. > > Now in this particular case, it might not be a big deal. But the larger > the app, the more these considerations come into play. > > > > Joshua Scott wrote: > > 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] > > > > > > -- > > <http://aria-media.com/> > Aria Media Sagl > CP 234 > 6934 Bioggio > Switzerland > www.aria-media.com <http://aria-media.com/> > > > > > -- Aaron Rouse http://www.happyhacker.com/ ---------------------------------------------------------- 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] ----------------------------------------- CONFIDENTIALITY NOTICE: This email and any attachments may contain confidential information that is protected by law and is for the sole use of the individuals or entities to which it is addressed. If you are not the intended recipient, please notify the sender by replying to this email and destroying all copies of the communication and attachments. Further use, disclosure, copying, distribution of, or reliance upon the contents of this email and attachments is strictly prohibited. To contact Albany Medical Center, or for a copy of our privacy practices, please visit us on the Internet at www.amc.edu. ---------------------------------------------------------- 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]
