CFCs have a "soft" idea of a constructor. Basically, any code outside of
a method will be run when the object is created. Some developers don't
like this and instead would rather place such code in it's own method.
Therefore, they create an init method and call it after creating the
object. Nothing about CFCs makes this mandatory - it's just one person's
way of doing it. 

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Hire

Email    : [EMAIL PROTECTED]
WWW      : www.camdenfamily.com/morpheus
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: S. Isaac Dealey [mailto:info@;turnkey.to] 
> Sent: Friday, November 01, 2002 3:54 PM
> To: CF-Talk
> Subject: RE: Understanding Locking In CFMX
> 
[deletia]
> I'm curious. Can anyone explain to me why createObject() 
> isn't enough to
> instantiate the object? I mean, why it is that <cfset 
> server.myVar.init()/>
> would even be required here? It seems to me like the init() 
> could just as
> well be an assumed part of a constructor for the object/cfc/etc... And
> better still because it would be less code and less prone to 
> screw-ups that
> way.
> 
> S. Isaac Dealey
> Certified Advanced ColdFusion 5 Developer
> 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Reply via email to