stevelionbird
Programmer
Ok, I've having trouble deciding what would be the most efficient way to have variables accessible everywhere in an application.
I'm using an Application.cfc with cfmx 7, so my original idea (to make a deep copy of an application-scoped struct with duplicate() on each request to a request-scoped variable) doesn't work. The reason is that whenever I try to duplicate a structure in the application scope, coldfusion throws an error about duplicating components.
My question is what is the best way to keep my application (or I should say site-wide) variables in a scope that I don't have to constantly lock to access.
My current thinking is that I should avoid the application scope altogether and just make sure I make good use of the onRequestStart method to ensure everything I need is always set in the request scope. This does however seem like an ugly hack.
Any tips?
Thanks,
Steve
I'm using an Application.cfc with cfmx 7, so my original idea (to make a deep copy of an application-scoped struct with duplicate() on each request to a request-scoped variable) doesn't work. The reason is that whenever I try to duplicate a structure in the application scope, coldfusion throws an error about duplicating components.
My question is what is the best way to keep my application (or I should say site-wide) variables in a scope that I don't have to constantly lock to access.
My current thinking is that I should avoid the application scope altogether and just make sure I make good use of the onRequestStart method to ensure everything I need is always set in the request scope. This does however seem like an ugly hack.
Any tips?
Thanks,
Steve