> The problem (and I assume quite a known one) I had previously was that
> application scope variables could be read by cfincludes, but not by custom
> tags since they are in their own memory space. This appears to be
> the reason
> application.cfm is recommended against, and the purpose of using
> the request
> scope -- that it works for both cfincludes and custom tags. Is
> this correct?
That's a bit muddled....
* Application scope variables *can* be used in cfincludes and custom tags.
* The problem is if you call your entire application as a custom tag, then
the application.cfm file you might be relying on when running it directly
won't be called. Get it?
> If so, what is the magic behind the request scope, and how much
> performance
> does it cost? I've got 50 application-wide variables, and I hate
> to set them
> every page request.
setting 50 variables is negligible. (OK I haven't actually tested that but I
use this sort of technique all the time and I haven't been smitten by
lightning bolts yet.) If I use Application scope variables I copy them to
Request scope at the beginning of each page anyway. For something like a DSN
for example, I would set it "Request.DSN=..." in app_globals.
Regards,
Matthew Walker
<!---
============================================
E l e c t r i c S h e e p W e b
--------------------------------------------
Tel....: +64-3-374 2137
Mobile.: +64-25-605 5747
Fax....: +64-3-377 7930
Web....: http://www.electricsheep.co.nz/
Post...: P O Box 13-907, Armagh
Christchurch, New Zealand
Street.: 71 Durham Street
Christchurch, New Zealand
============================================
--->
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists