Archive for March 2007
CFJSON version 1.7
Friday, March 2nd, 2007

Today I had some free time and decided to implement some bug fixes for CFJSON. Many thanks to Larry Reinhard who not only provided many fixes but actually built a unit test for them. Wow! That makes my work that much easier! Steve Nelson also contributed and I thank him for that.

After implementing Larry’s changes I so happened to read a post on Ben Nadel’s blog about a problem with a JSON string that had a carriage return. This incited me to go and check if special characters were properly handled, and I discovered that while they were as far as encoding, the decoding was not correct. In the process of fixing this I discovered a serious bug that caused errors when there was one double-quote in a string within a complex data type. I tracked it down to an inexplicable problem with a loop, whereby I incremented the loop’s index value to essentially skip an iteration, but for whatever reason on the next iteration the value of the index was reset to the original value it would have had if I hadn’t incremented it. Mystery… I just changed the loop to a conditional loop where I incremented values myself and that solved my problem.

So given the bugs mentioned above, this version of CFJSON is a must download. Hopefully there won’t be too many serious problems from now on, the transition from one owner to the next and implementation of accumulated code/bug fixes/features made it so some unpleasant stuff crept in, but it’s looking under control now. Thanks again to all the contributors!

DOWNLOAD CFJSON v1.7
GO TO THE CFJSON SITE

Getting familiar with ColdFusion frameworks
Thursday, March 1st, 2007

I recently had a look at two of the most popular ColdFusion frameworks, Mach-II and Model-Glue. And since I got the latest Model-Glue, the Unity release (still in beta), I was also exposed to ColdSpring and Reactor. It was long-overdue on my part to have a look at those. I can’t say I’ve gone in-depth into each one of them, but I understand the basic principles and could write a simple app/site using those frameworks. The question is, would I want to? I’m actually a big fan of frameworks/APIs/Libraries because they allow you to concentrate on your specific problem while providing you with a context in which to solve it, along with an intelligent way of organizing your code. That’s wonderful. But it’s becoming clear to me that there’s no right way of doing this and what works for/appeals to somebody doesn’t necessarily work for somebody else.

Both Mach-II and Model-Glue don’t really turn me on, at least not at first glance. Maybe I have to let them grow on me. Right from the beginning, at the very core of them, there’s XML. I can’t stand XML, I just can’t help it. In both Mach-II and Model-Glue, there’s a considerable amount of stuff that gets set up in XML files, they’re a fundamental part of the frameworks, unfortunately for me. Essentially, you define events that broadcast messages heard by listeners that provoke some action to be taken, and possibly generating output to the screen. In essence, I like the principle, I guess I may just not like the implemementation.

So that I don’t come accross as a total framework hater, I have to say that I’m quite a fan of Ruby on Rails. I think the way they go about it is more intuitive to me, I think their approach of using a lot of naming conventions helps minimize the amount of configuration needed. Just follow the conventions and things get magically connected and meshed in the background. I like that. On the ColdFusion end of things, from my (very) limited experience with it, I’d say that I also like Reactor as a framework, although we’re talking about totally different kind of framework here.

Bottomline, I think I may have to come up with a real project to get a better feel for the existing ColdFusion frameworks. In my case I’d go with Model-Glue:Unity, with Reactor plugged in. That way I get the benefit of testing 3 frameworks at once. And I could also take the opportunity to throw YUI and YUI-Ext into the mix to get my javascript groove on. I don’t know where I’ll find the time, but hopefully I can sneak in a few minutes here and there for the sake of knowledge.