Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
steve@averum.com #1
Is cfinclude'ing from CFCs bad?
Is it bad to CFINCLUDE a cfm file from a ColdFusion Component?
We have run into some strange problems, which we believe are related to a
shortage of RAM. But it was also suggested that the problem may be that we are
cfinclude'ing files from our CFCs.
Does anyone have any knowledge about whether cfnclude's from cfc's are bad? I
am not so much asking about best practices but rather whether it will cause
unexpected errors.
thanks,
Steven Rubenstein
steve@averum.com Guest
-
CFCs and RemoteObject
I currently have an application that is calling a CFC, via RemoteObject, and the results are populating a datagrid. How can I pass an argument back... -
cftransaction across cfcs
Hi there, There seems to be a REALLY irritating 'feature' of Coldfusion MX, to do with using cftransaction across function call boundaries, which... -
CFCs & Dot Notation
Here is what I have. A CFC with filename amCurPatientCount.cfc which is located in the "components" folder under the webroot. I have been able to... -
CFCs and MX7
I have a site with a photo album that utilizes CFCs and it worked great until my ISP switched to MX7. When they asked me if I thought I would have... -
CFCs and OO design
Howdy folks, I am new to using CFC's (and to be honest, new to OO in general), and I'm trying to use them for the first time. Let me explain my... -
externalError #2
Re: Is cfinclude'ing from CFCs bad?
I never tried that, but tell me ... why do you use CFInclude inside a CFC?
externalError Guest
-
Adam Cameron #3
Re: Is cfinclude'ing from CFCs bad?
> Is it bad to CFINCLUDE a cfm file from a ColdFusion Component?
If you're running CFMX 6.1, it's an idea to tread cautiously here.
When you have a <cfinclude> within a <cffunction>, it automatically copies
all your function-local variables to the variables scope. This can create
"unexpected behaviour", especially if you are "caching" a component
instance in a shared scope for ease of re-use.
I believe this has been addressed in CFMX7, but I have not checked yet.
--
Adam
Adam Cameron Guest
-
wubwub #4
Re: Is cfinclude'ing from CFCs bad?
Ive got a couple of small aps that I use CFINCLUDES inside a CFC. I normally
use CFINCLUDES to shuffle some of the CFFUNCTION blocks off to separate files.
I only use it for full CFFUNCTION blocks, never parts of a block, but it seems
to work just fine for us.
wubwub Guest
-
steve@averum.com #5
Re: Is cfinclude'ing from CFCs bad?
Just a follow-up after exchanging emails with Sean Corfield, Director of
Architecture at Macromedia.
He said that cfinclude'ing files from CFC functions "is bad practice". I
personally thought it was good practice to simplify the CFCs, but he said that
not using cfinclude's encourages people "to refactor their CFCs into smaller,
more cohesive CFCs."
As for copying "var" variables into the Variables scope in included files,
this is a CFMX 6.1 bug that, according to Sean, is fixed in CF7.
Sean did not specifically say that using cfinclude's will cause errors, but I
am inclined to believe this practice did contribute to our weird errors. Our
errors were unrelated to the Variables scope and I am confident they will be
solved now that we added RAM to our server, but that is not to say the
cfinclude's did not contribute.
CF's documentation does say it is ok to use cfinclude's so we are probably
going to run some tests before moving all of our code into the CFC itself.
steve@averum.com Guest
-
ajpowellatl #6
Re: Is cfinclude'ing from CFCs bad?
It would make more logical sense to me if you put the code from the template
you're calling in the cfinclude statement into a cfc and then use the
extends="" property of cfcomponent to get it into your component. Just my two
cents.
ajpowellatl Guest



Reply With Quote

