Can you Overwrite this.datasource in a ColdFusion App?
We all know the benefits of being able to write `this.datasource` in your Application.cfc. However, does anyone know if there's a way to override or change this value elseware in the app?
For example, you might have a configuration CFC or JSON file that would need the App to use a different `this.datasource` value. It would be great to be able to change this on the fly if needed.
My only theory as of now (untested) would be to create a method in the Application.cfc which would re-assign the datasource dynamically like this:
function setDatasource() {
// read configuration file...
this.datasource = 'foo';
}You could then call this method somewhere in your app using the application scope like this:
`application.setDatasource()`
Any thoughts or input would be most welcome 🙂
