yes, but keep in mind what is trying to be accomplished. which is to reduce
the access to shared resource variables, thus needing locking.  I would
prefer to take the hit in setting constants each page request, than worry
about the locking around each read and write access, including isDefined.

-----Original Message-----
From: stas [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 29, 2001 3:05 PM
To: CF-Talk
Subject: Re: Request vs application scope


Isn't it a bit illogical to use request scope for storing constants if they
can be overwritten? I understand that there is no sense in doing <cfif
isdefined("request.myvar")....> as the variable will be destroyed no matter
what, so you have to always re-initialize it. Does that carry more or less
penalty than checking for existence of an application scope variable with
isdefined()?


----- Original Message -----
From: "Dave Watts" <[EMAIL PROTECTED]>


> Brilliant! So what's the downside? The variables are not
> persistent across pages are they?

Request variables aren't persistent across pages, as Session, Application
and Server variables are. However, you're using them in Application.cfm, so
they'll be available on every page. They'll simply be recreated for every
page. Since you're using them as constants, there isn't really any downside
to using them.

Dave Watts, CTO, Fig Leaf Software
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to