Morning,

My biggest gripe with CFC's is the fact that for every request i am creating a new object, an object that is identical in nature to every other request to that page. So for example if i take one of the sample CFC's found on CFCDEV (http://www.cfczone.org/cfcs/) then if i have 100 concurrent requests to a page that uses a given CFC, then thats 100 objects i have created, where the 1 would have done.

Yes, I could cache them in SESSION/APPLICATION etc but thats overhead and placing the responsibility on me, the CFML developer. I might not even have a [session/application] scope available to me at that time.

If somehow we could 'pool' object instances then this would reduce memory/speed greatly. For the applications i am working on it would increase the overall performance significantly.

So for example, one could create pooled versions of a CFC:

  <cfset myCFC = CreateCFC("my.mycfc")>

Where this object would not be created every time, but a reference passed back to the one object passed back to it. The majority of the CFC's are not holding data per-se but operating on data passed in; very much how we use to work with custom-tags in their hey day. Custom-tags only had one instance in the 100concurrent page scenario.

Let the underlying engine worry about the object instances; if I create an object using CreateObject() then its business as usual. But I create it with CreateCFC() then its a pool object, that will be shared. It may not exist, as the underlying engine would be allowed to only keep the last x number of used CFCs and create new ones on demand.

Love to hear your thoughts on this topic.

thx

--
Alan Williamson, City Planner

w: http://www.BLOG-CITY.com/
b: http://alan.blog-city.com/
e: [EMAIL PROTECTED]
p: http://www.blog-city.com/profiles/9.htm


---------------------------------------------------------- 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]



Reply via email to