Title: RE: curious: why an xml config file?
Thread: curious: why an xml config file?
Forum: Need Help?
I think the reason why so many frameworks (and applications, programs,
etc) rely on XML files for configuration and settings is a bit more deep and I
guess even philosophical in nature. This, in my opinion, comes from the
separation between data and implementation. All these coldbox settings that you
see on the XML are actually the data that another program (ie the framework)
will operate on. Data and implementation, being different in nature, belong to
different places. Hard-coding the data - the settings - as coldfusion variables
on the Application.cfc or some other init file, will of course work perfectly
and will even shave off some mili-seconds of processing time since there is no
IO involved due to reading the external XML file; However this will come at the
expense of forcing you to change the actual implementation (the code) whenever
the data changes, which is a less than ideal situation.
To illustrate this
with an extreme example imagine an address book application that has all the
data hard-coded on coldfusion templates and that everytime a record is modified,
the application will need to rewrite the CF files. Yes, this is a bit
far-fetched but the point is the same: programs are machines that have an input
and an output and this same machine should be able to work UNCHANGED regardless
of its input. The input in the case of the framework are the settings defined on
On the other hand, there is nothing stopping you from having
the settings hard-coded on coldfusion variables, as we can see by Luis's plans
of allowing for this; but in doing this, because of the reasons mentioned above,
you will be negating the abstraction and structure that is achieved by the use
of a framework like coldbox.