The advantage is that you only create them when they're needed.

OK, so in that trivial example, there's virtually no difference, but you
may have to do some more complicated stuff on application startup. For
instance, reading, parsing and initializing language files and
variables, if your application is internationalized. Or performing
complicated queries for dynamic site configuration that might take
seconds to run - you'd then want to cache the results in application
scope and duplicate them out. I've done both of these, and when setting
up the variables takes minutes but duplicating them out takes
milliseconds, it's a real no-brainer.

  _____  

From: Pascal Peters [mailto:[EMAIL PROTECTED]
Sent: 28 May 2004 09:30
To: CF-Talk
Subject: RE: CFLOCK

I don't see the advantage over setting them in the request scope
directly. I don't think duplicating the structure will be much faster
than creating the structure (unless this takes a lot of db interaction
or processing.

> -----Original Message-----
> From: Alistair Davidson [mailto:[EMAIL PROTECTED]
> Sent: vrijdag 28 mei 2004 10:26
> To: CF-Talk
> Subject: RE: CFLOCK
>
> Connie
>
> Personally I've tended to store my global settings in an
> application-scoped struct, but duplicate them into request
> scope for unlocked usage, like this:
>

  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to