Saturday, May 28, 2005

Kicking It Old School with Fusebox 3

It was bound to happen sooner or later--I knew one day I'd be faced with tackling Fusebox. Given its pervasiveness in the CF community I'm just surprised it took as long as it did. Recently I was asked to evaluate an application (peer review) that was written in Fusebox 3 so I took the opportunity to re-read the excellent Fusebox: Developing ColdFusion Applications by Jeff Peters and Nat Papovich. I'd kinda sorta read this book numerous times in the past, and I've worked a bit on pre-existing Fusebox 3 applications before, but this was the first time I really spent a lot of time wrapping my brain around it.

First I should say that I was never really a Fusebox fan before, but upon what is probably the fifth or sixth read of this book, I can honestly say I probably didn't like it before because I hadn't experienced enough pain yet as a developer from the standpoint of dealing with poorly-written spaghetti-code that brings on diziness, nausea, and a lot of cursing just to look at it. I also think my experience with Mach-II has, oddly enough, made me understand Fusebox a bit better. Now that I think I understand it much better, I'm really starting to like it a whole lot more.

The other impetus behind my recent revisiting of Fusebox 3 is because I potentially have a big development project coming up (contract job) and the client is using ColdFusion 5 and probably doesn't want to upgrade at this point. So rather than develop the way I used to develop in CF 5 (which would likely bring on all the negative side effects mentioned above), I decided I better take another run at Fusebox. After all, with so many people behind it, it must have some merit.

The first thing that struck me was how, in my mind at any rate, Fusebox 3 really kind of models objects without using objects. This might be a crude analogy, but what struck me is that circuits are kind of like objects, while fuses are kind of like methods that would be in an object. The other thing I was very impressed with that didn't seem to take hold in my previous studies of Fusebox was the extreme modularity it achieves; it's like tight cohesion and loose coupling, only without objects. Again, I think I didn't appreciate this before because I hadn't yet been through enough nasty projects and torn out enough hair to really get how important this is. Now that I'm older, wiser, and have enough holes in my scalp, I had the lightbulb moment with Fusebox that's mentioned in the early pages of the book.

Probably because I have a Java background I had the lightbulb moment with OO very early on, and frameworks like Mach-II made sense to me immediately. Since I've done so many projects with Mach-II now and seen the tremendous benefits frameworks offer (clients *do* change their minds now and again ...), I think I can now appreciate Fusebox 3 a lot more, and it has me a lot more interested in learning Fusebox 4.1.

So wish me luck as I "kick it old school" with this new development project on CF 5 and Fusebox 3. Even though this puts me back squarely in the year 2001 or so, I'm actually excited because it's a huge part of the CF community and culture that I just haven't had much experience with yet, and because I'm so used to using CFCs in CFMX now, I think I'd probably lose my mind if I went back to CF 5 development without some sort of framework. Maybe that's also why I'm thinking of the circuits = objects/fuses = methods analogy--it'll make me feel like I'm using objects even if I'm not. ;-)


Hey Matt,

Glad you were able to revisit and see the benefit of the Fusebox methodology. If you need any assistance on your new project "kicking it old school" give me a call. ;o)


Hey Matt, I'm about to embark on using CFCs in an FB3 app for the first time. I've used them a lot FB4 apps, but never in FB3. Did you find any example apps or best practices for this combo, or did you come up with your own? Thanks.

Hi Steve--I guess my question would be if you have the ability to use CFCs, why not use FB 4.1? Since FB3 came out pre-CFC availability but you have to be on CFMX 6.1 or better to use CFCs, I'd be curious as to why CFCs with FB3 instead of just using FB 4.1.

Well, the short answer is that Fusebox 3 is our agency's coding standard. So, I need to code in that even though we're using CF6.1.

But, all of this is now moot, as I found out yesterday that the server which the app will live on is still running CF5. Arrrgh!

So, no CFCs for you! :(

Hi Matt, I just found your blog while looking for a clear explanation on why use EAR over WAR file or the other way around (Still no luck) But I did find your blog on Fusebox and I'm glad you've seen the light (jk).

I've been using Fusebox for over 2 years now and I'm building a multi-deployment application for my organization using Fb4.1. It's a little disheartening seeing the faces of some of the people I have met (Developers) through the local Usergroup (WAMMO) give me a puzzled look when I mention Fusebox or even Mach II (while I know OF mach-ii I do not KNOW mach-ii), most of them don't seem to use a framework at all. or maybe I'm just asking the wrong questions.
In any case, I wanted to ask you how your project is going and what your lasting impressions over using fb over mach-ii are

Hi Rodrigo--actually the project in question didn't happen the way I thought it would; my options are wide open and I'll probably end up using Mach-II for it (the project is a very slow starter in case you were wondering about the timing!). I really did appreciate the opportunity to get up to speed on FB 3 and I've since picked up Jeff Peters' books on FB 4 and 4.1 as well, which are excellent.

Bottom line for me is that I still love the way Mach-II works and it completely jives with the way I think about things. Maybe that's why I picked up on it so quickly. I do have a new-found respect for FB as well, however, and I'm definitely in the camp that believes any framework (so long as it's a well-known, well-respected one) is better than no framework. The advantages far outweigh the disadvantages, which in many cases aren't really disadvantages per se but people refusing to give an inch to the framework (and in most cases that's all it is--about an inch to gain miles).

No comments: