CFCs are Macromedia's attempt to add some level of object oriented programming to Coldfusion MX. One CFC does not equal one UDF. A CFC could be though of as a collection of UDFs, although that is probably simplistic.
Where a UDF contains only one function, a CFC is more like a true "Object" in OOP terms because it contains a collection of functions, as well as data much like a structure. In fact you can access the properties of a CFC in the same syntax as you would a strtucture. These properties are shared between all the UDFs, but are specific to the CFC (unlike request or application variables which are "global.") You should read this article: http://www.benorama.com/coldfusion/index.htm and more specifically: http://www.benorama.com/coldfusion/patterns/part3.htm This will give you a broader idea of how they differ and when to use what. I personally am going to shy away from UDFs and Custom Tags, and use CFC as much as possible. Craig ----- Original Message ----- From: "Cedric Villat" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, January 02, 2003 11:06 AM Subject: UDF or CFC > I'm wondering what the difference between a UDF and a CFC really are. Can't > I create UDF's which function just the same as a CFC with maybe a few > differences? Just pass the parameters in the function instead of using the > tag notation. Are there reasons why one would use a UDF instead of a CFC? Or > are CFC's just MX's way of dealing with functions? > > Cedric > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm

