Honestly, most of the time the config files that I work with are simple enough that they don't warrant validation. I'm with Ben when he says "let it crap out" and debugging it will be easy enough. If you're validating data files it's one thing, but for a lot of config files it's overkill to even bother with a DTD or schema. Having said that, I've said that preference is difficult to argue, and since validation seems to be a big concern for many I'm going to build some validation functionality for CFJSON. I've already started and have something very basic working. I'll post it on the CFJSON site in the next few days hopefully and maybe I can get some feedback. Also, if anybody knows of any efforts to set a standard for JSON validation, let me know so I can do something following established standards. I probably should have asked before doing any work at all, but I did a quick google search that didn't bring much back other than a few small attempts.
-TM -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jared Rypka-Hauer Sent: Sunday, March 25, 2007 4:03 AM To: [email protected] Subject: Re: [Reactor for CF] XML Configuration Files 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/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
