There are quite a few other application frameworks for ColdFusion out there, so why write another one? This is a very good question and in this blog post i’ll try to give you an answer and a brief overview of blade.
Why write another application framework?
I like the way how conventions work. There are a few rules you have to follow and behind the scenes the magic will happen. That’s why i really love FW/1. No need to write Xml configuration files such as in ModelGlue nor read over 600 pages of documentation such as in ColdBox. Just place your controllers in the controllers and the services in the services directory. It couldn’t be easier!
However, there are some things which FW/1 have not built in, since FW/1 is a small, lightweight MVC framework. Nothing more. BUT: The real worlds weight is far from “light”. So i’ve been digging around for an existing application framework but have nothing found which suite my needs of
- MVC
- built in ColdFusion ORM
- BeanFactory
- Validation
- convention based
- easy to learn and use
- rapid development
I think the only way to go before blade was cfWheels. But I don’t like how cfWheels pushes you to over-simplify your code (such as scopeless variables).
Overview of blade
Installation
Download the zip file from RIAForge und unpack it. You will get three different directories:
- blade (the application framework - see description below)
- samples (sample applications)
- skeleton (an empty application skeleton)
To install blade, copy the blade directory to your webroot.
The Framework
- hyrule (the hyrule validation framework)
- org (FW/1)
- wirebox (the WireBox IoC framework)
- Application.cfc
The Application.cfc extends Sean Corfield’s FW/1, adds the BeanFactory and some functionality for validation purposes. You have to extend this CFC instead of FW/1. -
Binder.cfc
The Binder.cfc is used from within the Application.cfc and configurates WireBox how load your beans, controllers, models and services. - Injector.cfc
The Injector.cfc adds the getBean() and containsBean() method to the WireBox Injector. Those methods are needed by FW/1. -
Model.cfc
The Model.cfc is a Wrapper for all ColdFusion ORM functions and your model cfc’s have to extend this object. This Wrapper adds the ability to inject any objects into your model cfc’s. -
ValidationResult.cfc
The ValidationResult.cfc is needed by the Application.cfc to simplify the validation process. - mappings.cfm
You will have to cfinclude this file into your Application.cfc. It will create the mappings for the frameworks used inside of blade.
How to load blade
To load blade, just extend the blade.Application class and cfinclude the mappings.cfm:
<cfcomponent output="false" extends="blade.Application" hint="Applikationskomponente"> <cfinclude template="/blade/mappings.cfm" /> </cfcomponent>
See the FW/1 docs for a deeper look into the framework configuration. Please note, that the setupApplication and the setupSubsystem functions are used by blade. So if you want to customize these, make sure you call super.setupApplication() or super.setupSubsystem(argumentCollection=arguments) from within them first:
<cffunction name="setupApplication" returntype="void" access="public" output="false" hint="Wird beim Applikationsstart ausgeführt"> <cfset super.setupApplication() /> ... do your own stuff ... </cffunction>
The “model” directory
blade automatically threat all (not recursive!) of your objects in the “model” directory as transients. So you have the ability to store all of your ColdFusion ORM entities in this folder. Please make sure your entity objects extend the base model class of blade.
<cfcomponent accessors="true" output="false" persistent="true" extends="blade.Model" hint="Model"> ... </cfcomponent>
If you wan’t to inject a model cfc, just inject it with the id “cfcNameModel”.
<cfproperty name="userModel" inject="id:userModel" />
The “beans” directory
All of your objects in the “beans” directory will be recursively loaded and WireBox will store them as singletons. If you wan’t to inject your bean objects into your controllers, services, or model cfc’s please note, that the id of the object will be the reverted path inside of the beans directory. A bean called “profileChar” which is stored inside of the beans/util directory will get the id “profileCharUtil”.
-
beans
- util
- profilechar.cfc
- util
<cfproperty name="profileChar" inject="id:profileCharUtil" />
That’s it! For a deeper look into the framework, see the samples directory of the download.


Kerr 02. March 2011 um 09:16
Hi, this is very interesting stuff! I have the same general feelings as you about the various framework options available to CF developers today. I've tried most of them out, and found FW/1 to be dead simple to get into. I loved that it "just worked". I thought maybe, sooner or later, someone might start hanging things onto FW/1 and publishing their own full stack framework.
A couple thoughts:
A lot of readers here will likely be English speakers. The navigation here may be challenging to them (myself included) I'm not sure how difficult it would be to give your site the i18n treatment, but it's worth considering.
Have you utilized the ValidateThis validation framework? It happens to be my preference, but I like Hyrule as well.
One thing to consider for the future is Sean Corfield (and team) plans to introduce a "DI/1" dependency injection element alongside FW/1. I am very interested in the approach, as again I am a big fan of the choices made with FW/1 in terms of modularity and ease of use.
Marco Betschart 08. March 2011 um 20:33
Hy Kerr
You're right about your thoughts about my blog and i'm working on it. At the moment most of my readers understand german, but it's worth a try to translate ColdFusion related posts and the navigation of the blog to english in the near future.
A word about DI/1 and ValidateThis: I know about the plans of DI/1, but since the last update of the code in github is more than one year ago I don't wan't to wait anymore. I think WireBox is quite a big achievment in the right direction. Nevertheless I'm very excited about DI/1. We will see what's going on in the near future.
ValidateThis seems to be a framework which has never fit to me. I don't know why, but every time i gave it a try I had troubles to get it to work. Maybe I'm dump, but i prefer hyrule since it's extremely easy to extend and just works as I expect.
Kerr 16. March 2011 um 11:34
I completely understand -- It is nice to have options like Hyrule/ValidateThis and Wirebox/ColdSpring/upcoming DI/1 from which to choose!
Mark Ireland 22. March 2011 um 15:35
I have this error:
http://www.markireland.com.au/stepbystepblog/step2/install/
Marco Betschart 25. March 2011 um 13:35
Hi Mark
Please make sure you have ColdFusion 9 Update 1 installed (ColdFusion 9.0.1) since the Update contains massive improvements for ColdFusion. You can download it from here: http://www.adobe.com/support/coldfusion/downloads_updates.html#cf9
Daniel Schmid 10. October 2011 um 10:36
Hört sich interessant an. Nirgends lernt man mehr, als wenn man beginnt selber was zu probieren ;-) Wird das weiter entwickelt?
Wieso aber Coldbox komplizierter als FW/1 sein soll, werde ich nie wohl verstehen. 600 Seite Doku sind IMHO ein Feature! Zumal CB eigentlich eine Toolbox ist inklusive Cachebox, Wirebox, Logbox und vielem mehr. Der Funktionsumfang ist nicht zu vergleichen. Der MVC-Kontroller ist nur ein kleiner Teil. Meines Erachtens ist der Einsatzbereich einfach ein anderer.
Einverstanden bin ich damit, dass Konfigurations Frameworks wie Mach-II, Fusebox oder ModelGlue nicht mehr zeitgemäss sind. Für Enterprise Applikationen skalieren sie einfach nicht genügend. Die XML-Konfiguration ist zudem ein Effizienzkiller.
Marco Betschart 10. October 2011 um 20:37
Hallo Daniel!
Ja das wird weiter entwickelt und hat mittlerweile schon einige Versionsnummern hinter sich seit diesem Blogpost - Feedback ist jederzeit willkommen! :)
Ich denke "kompliziert" ist der falsche Ansatz - ColdBox ist einfach um längen umfangreicher als FW/1 und überfordert viele genau aus diesem Grund. Es ist einfacher etwas neues zu lernen als von 10'000 Dingen gleichzeitig bombardiert zu werden. 600 Seiten Dokumentation sind da nicht unbedingt Motivationsfördernd.
Genau das ist die Stärke von FW/1 - denn in vielen Applikationen wird der komplexe Umfang von ColdBox nicht benötigt. blade geht hier noch einen kleinen Schritt weiter und stellt FW/1 out of the box noch eine BeanFactory und einige Validationsroutinen zur Verfügung - die wichtigsten Funktionalitäten die in allen modernen Applikationen benötigt werden.
Daniel Schmid 17. October 2011 um 14:22
das verstehe ich schon. IMHO lassen sich Coldbox und FW/1 hald schlecht vergleichen. FW/1 ist ein klassischer, simpler FrontController im MVC-Setup, während Coldbox ne Toolbox für ausgewachsene Applikation ist, wo man all die Nettigkeiten wie i18n, Caching, Logging, ect. gerne schon mal dabei hat. Natürlich ist CB AUCH noch ein FrontController.
Zudem wachsen Applikationen gerne, da ist es hald angenehm das Framework bietet etwas mehr als NUR das C im MVC-Setup. Man muss ja auch nicht lesen, was man nicht gerade benötigt ;-)
FW/1 brauche ich gerne für Mura Plugins. Ansonst finde ich Coldbox praxisnaher und stringenter in Aufbau und Konzeption. Dependency Injection ist schon drin mit Wirebox und Hyrule übrigens auch.