Adobe ColdFusion Inconsistencies

I've run into a couple of ColdFusion quirks over the past few days that I thought I'd share. (I should note that these were observed on Adobe CF 8.)

SerializeJSON and Boolean Strings

If you try to serialize the strings "Yes","No","True" or "False" using SerializeJSON, ColdFusion will convert these strings to boolean values. (i.e. "Yes" becomes true, "False" becomes false). This is because ColdFusion is weakly typed and uses some pretty liberal implicit conversion rules when it comes to boolean evaluation. I see this as an issue for the purposes of searializing and deserializing JSON for two reasons. First, there is the potential to lose data. If you serialize the string "Yes" and then deserialize the JSON that ColdFusion generates you are left with true, which is obviously a totally different value than what you started with. Second, it is not really consistent behavior because SerialzeJSON does not convert 1 or 0 (also ColdFusion booleans) to the boolean values true and false. I think the better approach here would be to serialize all strings as strings and only serialize "real" boolean values as booleans.

IsXML()

The other inconsistency I ran into was with IsXML. If you pass something other than a string to IsXML the function throws an error. This is different than the documented behavior which states:

Returns

True, if the function parameter is a string that contains well-formed XML text; False, otherwise.

This is also different than the other CFML decision functions which simply return false if passed a function parameter they can't handle. (See IsXmlAttribute for example.)

I think the IsXML issue could definitely be consider a bug, and while the SerializeJSON issue is a little fuzzy, I've gone ahead and reported both as bugs.

Higher Education Web Symposium Wrap-Up

Last week I had the opportunity to attend the Higher Education Web Symposium here at Penn. Billed as "The first and only web design conference for IT Professionals working in Higher Education" the conference actually had a lot of great content for web developers working in any discipline.

[More]

ColdFire Update for FF 3.0.1

Last night I released ColdFire 1.2.51.70 which is compatible with FF 3.0.1. No real updates, just a change to the install manifest to indicate that ColdFire should be compatible with all FF 3.0.* releases.

Contributing to OSS

I use a good deal of open source software in my day to day development and maybe I'm just lucky, but I tend to find bugs in a lot of that software. I'm also the kind of developer that loves to dig into unfamiliar code and figure out what is going on. This usually leads to me tracking down the issue and submitting a patch back to the project. In just the past couple of weeks I've submitted, and had accepted, patches to both the Apache POI project as well as the Firebug project. Now, I'm far from an expert Java or Mozilla developer, but to fix a lot of bugs you don't necessarily have to know the technology in question backwards and forwards. Far more important is the fact that you have found the bug in the first place and have the ability to reproduce it consistently. Once you have done that you can usually track down the one or two lines causing the issue and figure out a solution. This type of bug fixing has lead to my becoming a core committer on a couple of high profile CF open source projects. Having said that, becoming a committer isn't all that common, and you shouldn't necessarily assume your patches will be accepted by the project. I've definitely had more patches ignored or outright rejected than I've had accepted and included in projects.

[More]

Firebug 1.2.0b6

A new beta of Firebug 1.2 has been released. I've done some quick tests with ColdFire 1.2 and everything seems to work, but if you run into any problems please let me know.

ModelLocator Dependencies in Cairngorm

I'm new to Flex, but realizing the benefits of using a framework in a team environment I decided to give Cairngorm a try for my first real Flex project. I had heard some not-so-good things about Cairngorm from a lot of developers I know and respect, but I figured I had to see for myself. At first I didn't really see much wrong with the micro-architecture. Sure there was a lot of repetitive boilerplate, but I was using a code generator so it wasn't that bad. Things were going along pretty well, that is until I got about half-way through the project and began to work on the administrative interface for this application, which happened to be a separate Flex application. Well, it turns out the administrative application could have reused a lot of the main application's views, that is if they didn't have hard coded references to the ModelLocator all over the place. Most of the script blocks in my views started out with statements like:

[More]

Do not pass GO

(This is a re-post from my work blog, but I thought I'd post it here for everyone else.)

ANT has a SQL task which allows you to execute SQL statements via JDBC which can be very handy in a number of projects. Currently I'm using this task to execute a directory of generated sql files, each of which defines a stored procedure for MS SQL Server. Here is what a typical one of these stored procdure SQL files looks like:

[More]

BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.