On Jan 22, 2004, at 2:40 AM, Mark Woods wrote:
As far as I know, this is the same with CFMX as templates included using cfinclude are not compiled into separate classes

No, all files are compiled separately (as classes). That's why there's no performance difference between include files and custom tags in CFMX.


You can test the performance difference by encapsulating a chunk of code into a separate template and then say create a loop calling the template 100 times. You'll notice the performance hit in your debug output calling the code as a module versus as an include.

You'll certainly notice it in CF5.


They have different functions as far as I'm concerned, but I'll use cfinclude where in theory I should really use a tag/module if I need to increase performance.

Something you wouldn't need to do in CFMX... but, yes, I think of them as having different functions.


For me, an include file is a mechanism for (a) making function definitions available and/or (b) including a piece of a page like a header or footer whereas a custom tag is for performing a specific (output-related) function. If I need a non-output-related function I tend to use a UDF (User-Defined Function) or, more likely, a CFC (ColdFusion Component).

To the original poster, if you have this line of code and it works:

<cfinclude template="other.cfm">

then this line of code is nearly identical and should also work:

<cf_other>

The only difference between them is the way that "variables" scope (or unqualified variable names) are handled inside other.cfm. In the first case, they are shared with the calling / including page; in the second case, they are managed separately (and you can access the calling page variables using "caller" scope).

Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to