> -----Original Message----- > > http://gbracha.blogspot.com/2007/06/constructors-considered-harmful.html > > And of course since CF is a dynamic language, none of that article > actually applies to CF. One of Gilad's main complaints is that you > can't return arbitrary objects from a constructor - which you can in > CF (and I do it in Fusebox 5.5 - because it introduces a new type of > circuit and the code can only figure it out half way through the > constructor so it decides which type of circuit to return from init() > - and they are not related by inheritance). > -- > > Sean A Corfield -- (904) 302-SEAN > An Architect's View -- http://corfield.org/
One could argue that in CF there is only one constructor, and it's CreateObject(). It's always accessible, and as the developer of a CFC I can do nothing to turn it off, influence its behaviour, or rely on any initialization being run other than the no-argument non-method "pseudo-constructor". Surely that was Gilad's other main point? True, we have powerful conventions and patterns to avoid pathological use of CreateObject(), but in terms of language design the situation remains. Jaime Metcher You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm CFCDev is supported by: Katapult Media, Inc. We are cool code geeks looking for fun projects to rock! www.katapultmedia.com An archive of the CFCDev list is available at www.mail-archive.com/cfcdev@cfczone.org