ColdFusion users have long wanted a way to define settings per application, rather than server-wide, even within a shared instance. ColdFusion 8 introduced the beginnings of per application settings via Application.cfc (which we introduced in CF7).
To set application settings using Application.cfc, variables are set in the THIS scope. THIS.name to set the application name, THIS.sessionManagement to enable session state management, and so on. In CF8, Application.cfc and the THIS scope can be used to define per application settings. For example, THIS.mappings is a structure which can be used to define ColdFusion mappings. To set a mapping you just modify that structure like this:
To set the Custom Tag path you can update THIS.customtagpaths which is a simple ColdFusion list. You can set the path like this:
Or use ListAppend() to add a path, like this:
It’s clean, simple, highly intuitive, and in CF8, limited to just those two settings – mappings and customtagpaths.
In CF9 (aka Centaur) we may have the opportunity to enhance this functionality. And actually, we’ve already started doing so. For example, at MAX in Europe I mentioned that CF9 allows for THIS.datasource to be defined as a default datasource, eliminating the need to specify the datasource for each and every query. And that’s just an example.
There are others I’d like to see, starting with THIS.logdirectory to set a log file location per application. But, rather than my list of settings, I am interested in yours.
Now, this should go without saying, but I’ll say it anyway. When discussing a future product there is no firm commitment being made about any features. Stuff can, and usually does, change. But, having said that …
What are the settings you’d like to see us support per application in CF9? Feel free to list multiple, but be sure to define them in the order of priority.
(Oh, and before the thread goes off on a tangent, yes, I know we need a way to define on-the-fly datasources as you could in CF5. But no, these are not technically application settings, and are out of scope for this thread).
Leave a Reply