Patti G. L. Hall wrote:
> Well, the thing is if you put that kind of code in application.cfm, you'll
> be calling it EVERY time youc all ANY template.
>
> For example, lets say that in your page you are calling a couple of
> includes... Maybe one has a udf library.  Maybe another has a whole bunch
of
> queries.  Maybe another has a calendar or something reusable like that.
In
> that case you will be calling application.cfm 4 times... Not just once,
> because every time one of those includes gets called, the application.cfm
> file is run first.  All The Time.

Actually, you're incorrect about this.  Application.cfm and OnRequestEnd.cfm
are respectively called at the beginning and end of a REQUEST, not an
INCLUDE.  They are not called every time a new CFM file is used internally
(i.e., by inclusion via CFINCLUDE, CFMODULE, UDF, CFC, etc.).

> This is kind of an exaggeration, but I hope it illustrated the point as to
> why you never put anything other that application *logic* in an
> application.cfm or onrequestend.cfm.  It's a gross abuse of the system and
> before long, as soon as your sites get any kind of complexity to them, it
> will cause many more headaches that it seems to solve.

You can actually make a very good argument for including headers and footers
from Application.cfm and OnRequestEnd.cfm instead of having to repeat the
code at the top and bottom of every file.  For example, all of the extra
code placements can result in bugs (typos, etc.).  Or, what if you change
the filename or path to the included files?  With App.cfm, you change the
path/filename in one place.  Granted you can do a global search and replace,
but the point is, there are benefits to including the global files in the
App.cfm et al files.

Even more so, BTW, versus putting it in a Custom Tag.  Custom Tags require
extra overhead for processing.

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 625-9191
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
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

Reply via email to