tracker issue : CF-3155857

select a category, or use search below
(searches all categories and all time range)

Application.cfc organizational changes

| View in Tracker

Status/Resolution/Reason: To Fix//

Reporter/Name(from Bugbase): David McGuigan / David McGuigan (David McGuigan)

Created: 04/02/2012

Components: Language

Versions: 10.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: Public Beta /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Win All

Vote Count: 2

It seems extremely counter-performant to me that we author application-level settings in the pseudo constructor in application.cfc instead of in onApplicationStart. For code that needs to react to the hard drive letter or evaluate other dynamic conditions, that means that your settings code has to run once for every request in your app, instead of just once at the startup of the app.

Can we please add the ability to put those settings on onApplicationStart? It would be nice to be able to do all of them there including the application name, but I imagine that might be the one that’d still need to live in the pseudo constructor, which I could live with.

From a discussion in the thread:

Ray Camden said: "I agree with this. A great example is custom logic to get paths to
important directories based on code that checks if the current
environment is development versus staging versus production.

What’s nice is that this could be backwards compatible. Consider this.mappings.

If you set it in onApplicationStart and do NOT set it in the
pseudo-constructor, then it should just work as is.
If you set it in the pseudo-constructor, it works as is.

If you set it in both, a dumb mistake, then the 'normal' CF mechanism
works and the pseudo-constructor one takes precedence."

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3155857

External Customer Info:
External Company:  
External Customer Name: David Michael McGuigan
External Customer Email:



+1 -- Adam /////////////////////
Vote by External U.
19799 | April 04, 2012 10:28:48 AM GMT
I build a little environment framework around that feature which stores its data in the server scope and structappend()'s its data to the this scope at runtime. On great point about the way ColdFusion handles the settings now is, that every change has an instant effect. From my point of view that runs very fast. If you want to change that to gain an performance boost, you propably have to completely shut the inpection of the settings on every request down. I doubt that this is possible without breaking a lot of legacy applications. Just one example: People could run 2 Application (scope) through one Application.cfc, by just varying In a nutshell, the way ColdFusion handle it's application settings now, is amazingly flexible.
Comment by External U.
19798 | June 19, 2012 02:21:22 PM GMT
Vote by External U.
19800 | October 02, 2015 10:10:29 AM GMT