Viewing By Entry / Main
September 10, 2007
If you'd like to see what a Fusebox 5.5 application looks like - without XML - then you might want to download the cat club sample app. This is version three of the infamous frameworks comparison application reworked for Fusebox 5.5, to use the very latest bleeding edge release from the SVN repository. It won't work with the Alpha 2 build, so you'll need to be real adventurous to run it, but it should give you a good sense of what the new release will do for you.

Items of note include: Application.cfc integration with allowImplicitFusebox and the onFuseboxApplicationStart() method, controller circuit written as a CFC (in fact, it's written entirely in <cfscript> just to make a point) with prefuseaction() and postfuseaction() methods, views relying on attributes scope (and that the event object shadows it). The model is unchanged from the classic 'ggcc3' version.

If you don't already have the database tables created, you'll want to download the original frameworks sample code and run the build tables code (in ggcc1 as I recall).

Feedback welcome, as always. One thing I'm not very happy with right now is the view / attributes scope dependence. Fusebox views have always been able to rely on variables scope but setting variables scope values, while possible, is quite ugly in a CFC controller:

<cfset myFusebox.getTopLevelVariablesScope().someVar = someExpression />

I'm toying with the idea of:

<cfset myFusebox.setVariable("someVar",someExpression) />

which would sort of match how the event object (attributes scope) is handled:

<cfset event.setValue("someVar",someExpression) />

Of course, instead of using a getter, I could just expose that scope directly like this:

<cfset myFusebox.variables.someVar = someExpression />

which is somewhat more in keeping with the Fusebox idiom.

Comments

It's going to be quite a change from the XML files, but I really like it! :-)

One question: In 5.1 I'm using multiple XML controller files to separate parts of my application into smaller, manageable modules. Will I be able to do that here as well?

I also like the fact that I won't have to deal with XML files in the model or views folder (if I understand what's going on correctly)

I kind of like the idea of just exposing that scope since that is how it's worked in the past. It's easier to read. However, I understand there are benefits to doing it the other way.

Thanks a lot for the sample app. That really helps me understand the changes to 5.5 more clearly.


By the way... What is the reasoning to moving Fusebox over to CFCs from XML? Is it faster? Easier for CF people to pickup?

It seems that it would cause a fork with the PHP version of Fusebox, although I don't know how popular that is in the first place.

In the end, I like the move to CFCs, I imagine it would offer some additional possibilities and keep you from having to duplicate CF functionality in the XML grammar.


All Fusebox 4 and Fusebox 5 applications will run unchanged on Fusebox 5.5. You can still use XML if you want to.

The whole reason for make XML *optional* is feedback from the community that a lot of people do not like XML and feel it's a barrier to entry.

Mike Ritchie is tracking Fusebox 5.5 for his PHP version (he was in progress on Fusebox 5.1 for PHP but will likely jump straight to Fusebox 5.5 for PHP).

Hope that clarifies?


Sean,

I absolutely LOVE being able to skip the XML, if I so desire. To me, this really opens up FB to many more apps. Also love the all-cfscript controller CFC :)

Looking forward to the official release!


Thanx Matt. I'm starting to write Fusebox apps without XML now and enjoying the convention-over-configuration approach! As soon as I add prefuseaction / postfuseaction for implicit circuits-as-directories, Fusebox 5.5 will be feature complete and I will make the Public Beta available. Soon.


Seems like it is becoming more like the Coldbox framework which uses cfml setup, no xml. Would you say it offers any benefits over Coldbox, or just different? If the latter, how so? Thanks.


Fusebox started down this path before I'd looked at ColdBox. I was quite surprised to see these similarities when I first looked at ColdBox in any detail last week (I'd tried to download it a while back but it wouldn't run out of the box so I gave up).

ColdBox actually *does* use XML - to configure layouts and views as well as other application parameters.

Fusebox 5.5 allows you to programmatically configure the application without XML as well as allowing you to write circuits without XML. If you look at the sample code, you'll see the controller circuit is a CFC but the view circuit is just a directory containing .cfm files - and that still behaves like a circuit.

Fusebox 5.5 still allows all the traditional FB4 and FB5 apps to run so it supports several different styles of programming. ColdBox requires controllers (event handlers) to be written as CFCs which is just one possibility with Fusebox.

So, overall, I'd say they're more different than they are similar.

As for benefits, Fusebox has the largest community and the most documentation (including several books) - which is not to diminish the amazing work done by Luis on the ColdBox documentation!


Ugh. Don't worry about the Fusebox "idiom." It's a vestige of the early days, when we didn't have UDFs. I don't see any reason to keep with it now, especially since accessors are already present in the event object.

I like the CFC controller. I can actually read it!


When I try to run GGCC55 I can't get the newtask fuseaction to work without removing the scope from the variables in the two cfloops in dspNewTask.cfm. This seems like a bug but I haven't fuseboxed since version 3 and I am wondering if the code is suppose to work as written.


@Steve, that's a Mach-II variant and I can't repro your problem (although I did spot a bug in Mach-II by trying it). What CFML engine are you running on?


In Fusebox 5.5, any reason the Model isn't a cfc that you can call methods on? Or is there another way to do this that I'm not seeing.


@BL, the model (circuit) can indeed be a CFC.


Really, nice. Can I do this straight up or do I have to use custom lexicons or anything? Do you have an example showing this?


@BL, custom lexicons are XML-only. If you're using the no-XML version, you just use plain CFML.

I suggest you join the Fusebox 5 mailing list (link on the fusebox.org website) and ask questions there.


Post Your Comments
Name:
Email Address:
Comments
*** Please note that all comments require moderation so it may be some time before your comment posts to this blog! ***
Remember My Information:
 



Hosting provided by