On Mar 24, 2007, at 1:09 PM, Sean Corfield wrote:

On 3/24/07, Todd Cullen <[EMAIL PROTECTED]> wrote:
Quick Question (or maybe not that quick): Why do most of the ColdFusion frameworks around use XML configuration files rather than providing methods to build the required data structure in ColdFusion? Something in line with
what RoR does.

The main reason for using XML is that it's very easy to manipulate
programmatically which makes it very amenable to driving a framework
and/or building tools around a particular XML specification. XML
provides a fairly rich language for specifying the structure and/or
behavior of your application.

I actually have a fairly strong opinion on this subject... so please don't think I'm coming down on ANYONE. I just really feel strongly about it.

/disclaimer!

Two words: Schema and DTD.

Try validating an ad-hoc config file with something as convenient as almost any modern XML editor... :) yeah, didn't think so. Try getting editor insight from your file system for your config by convention setup. XML Schema and DTD provide editors with support for insight... very nice for developers needing it (goes far beyond a spec, or a developer's guide).

Why people go so far to avoid XML is beyond me. It's like a grave digger being afraid of a shovel because they don't understand it and saw some other grave digger using a tree branch... good enough for them well, good enough for me! Wrong. XML is syntactically rich, human-readable, easily validated, and can be manipulated programmatically, searched, queried, saved back to disk, looped over, validated, transformed, and, well, frankly for my money I'd use XML over a straight-up config file, convention, or an INI file any day. Why?

Goes back (mostly) to Schema and DTD. When building, for instance, a ModelGlue application and I can get tag insight, document validation and error reporting, XPath, XSLT...

Basically if your config file or config convention is a Porsche, then XML is my flying car. :)

As Sean says, convention and alternative config options can only take you so far. XML can take you about anywhere.

I am, however, very excited to see what, if anything, JSON can offer us in the future.

Laterz,
J


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to