On 4/19/05, Ryan Sabir <[EMAIL PROTECTED]> wrote: > I was thinking in the Application scope you would only have to set > them once, and thereafter check if they were already initialised, > rather than setting them on every page request.
These are all tradeoffs. Setting simple variables in request scope means no locking, no conditional code - but you have the (small) memory overhead of setting the variables in every request. It all depends on what you are doing. If you are just talking about having DSN and maybe a handful of other simple values as 'global' constants then putting them in request scope is simple and fast. If you are talking about a whole slew of variables, particularly if you have structured data or read them from a config file, then it makes sense to create some sort of config object and instantiate it once in application scope. I wouldn't bother doing that for just a global DSN variable. Like I say, tradeoffs. And of course the answer is different if you use a framework (Fusebox, Model-Glue, etc) because those have a "standard" way to handle 'application constants'... -- Sean A Corfield -- http://corfield.org/ Team Fusebox -- http://fusebox.org/ Got Gmail? -- I have 50, yes 50, invites to give away! "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] Aussie Macromedia Developers: http://lists.daemon.com.au/
