> What you're suggesting is predicated on the above statement being
> true. But it's not, in most situations.
> Basically you're not using a CFC instance an object, you're using it
> as a bag-of-functions. That's not the intent. It's an entirely valid
> practice, but it's not the intent.
Thats a very arguable point Adam. Looking at all the 'bag-of-functions' CFC listed on CFZONE, and the majority of them are not holding instance data. It depends largely on your application development; so to say one way or the other is wrong. One has to accept that CFC's are flexible enough to allow both situations and leave it that.
I didn't say it was wrong. In fact I explicitly said it was an entirely valid practice (even in the bit you quote me on). However, CFCs are intended to be able to be stateful, so *by default* caching a single instance of them "to speed things up" is not a sensible idea. What would make more sense would be for CF to not be so slow at instantiating a CFC.
> A CFC is an object.
Well, no. It's not. A CFC is analogous to a class. A CFC *instance* is an object. Or CF's facsimile thereof.
And, indeed, CFCs actually *are* cached by CF already.
> How one uses that object is really up to the end developer. Many other languages have the notion of the caching of objects at a core level,
How is this done? Or maybe a better question, "what do you mean by caching in this context?". What do they cache? Do they cache the methods of an object but no member variable data? How would that work in CF when you can create member variables in the pseudo-constructor part of the CFC? It somehow *ignores* that code? Sounds dodgy to me, but I guess it would be possible (easier if CF just had constructors, eh?). Or do they cache the class? Well so does CF.
(the last time I looked at memory management practices of a programming language was my stage 2 C/C++ course at polytech, about… urgh… 12-13 years ago, so I'm not very up with the play on this sort of notion)
>So why shouldn't CF expose that same level of functionality to the developer?
CF is aimed at a market which thinks angle brackets make coding easier because it looks like HTML. Nuff said.
--
Adam
This email contains confidential information. If you are not the intended recipient of this email, please notify Straker Interactive and delete the email. You are not entitled to use it in any way.
---------------------------------------------------------- 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]