At the moment we're creating general components that look
like the examples in the CF MX Bible book.
In these components we've defined an application var that
contains the database name, so the component could be used by
multiple websites/application.cfc etc.
These components are also created in a general folder with
mappings redirecting to it.
We're working with some webservices options with the same
cfc, so we created a website with the home directory as our general
This all looks fine and dandy, but let's say website A uses
database B and website C uses database D, all nicely defined in the
application.cfc of those websites.
And let's say that we've created a webservice from the
general cfc folder which checks addresses and returns the results,
if website A and C needs them.
The problem now is that the webservice website doesn't know
the application var that contains the database name for website A
I know that the address webservice is not really a good
example, since you usually just have 1 global address database for
it, but there are certain situations where website A needs to call
a webservice that checks a different database than website C.
I've been thinking of a solution, but I just want to know if
anyone has done this before or that they can share their idea about
I'm against the idea of having the datasource as an argument.
Especially when working with webservices.
My own idea about it at the moment, is creating an
application.cfc in the webservices directory and creating the logic
which database it should select and set the application var with
Altho your idea is workable, just a style preference I