CF on Rails
July 24, 2005
I have noticed two CFML developers have made the switch to Ruby On Rails (a Rapid Web Application Development Framework for the Ruby programming language).
Michael Buffington was the first CF developer I noticed make the switch:
I took a perfectly good (arguably) ColdFusion application and rebuilt it from the ground up in Ruby on Rails. My goal was to match features exactly, but I couldn't help but toss in some subtle Ajax improvements as well as clean up all the URLs for the app (more after the jump).
I'm super pleased with the outcome, and the entire process of the rebuild.
Building a Rails app for me was very satisfying. I had just started becoming comfortable with Ruby, and once I actually planned out the wordPhoto.org rebuild, it really became fun. The leaps and bounds you can make quickly with Rails is truly amazing. I'm used to rapid application building with ColdFusion, but Rails is more rapid, which was a surprise.
I should point out that Michael is no CF newbie, he has been working with it for years, and has even given some talks at conferences on ColdFusion.
Greg at SocialTwister has moved to rails, and writes:
For my fellow CFers out there, I'll simply say that I still love CF, but Rails Rocks. My CF code was written very similar to the way Rails works now so it made a lot of sense.
So can we build a framework as cool as ruby on rails for coldfusion?
I tend to think so, CFML has been the king of RAD web development for the past 10 years. CFML is a language that was designed for rapid development. Ruby on Rails is a framework for the Ruby programming language. I would think having a good framework for RAD development in CFML would be able to beat RAD development in Ruby any day. But perhaps I'm just biased?
You can't really blame Michael, or Greg for switching - they just want to turn their ideas into apps quickly. CF is great for that, but they have found Ruby on Rails to be faster and easier for their needs. I'm sure if they had a framework for CFML that did what rails can do, they would be looking at it.
Trackback Address: 416/40271E97C79F2DCDBC5C521A8D98CD1A
So, what does rails do for ruby? What sort of things do the framework do for you that makes it so easy for rapid development? This sounds like something that COAL is designed for, but im not sure until I know exactly what rails does... http://coal.ryanguill.com
This link has more info on Ruby on Rails: http://www.rubyonrails.com/
I know that Joe Rinehart has been working something "rails like" for use with the model-glue framework called Rocket. There aren't many details out there, but I believe that's the intent.
as far as the i18n world goes, it's more like ruby-off-the-rails, it's pretty primitive (i've seen the word 'lame' used to describe it). i suppose that will change eventually but it took cf years and php even longer to get anything really useful going.
I've been thinking about writing a "hey CF community, we're falling behind! we need a CF on Rails!" type app post for awhile, but I haven't done quite enough research to be able to really say that. For one thing, I haven't yet used Ruby, but I've read that one of the reasons that RoR works so well its because of it's "plain english" like syntax, much like Haskell.
One other reason I haven't posted about it is because I need to check out the Churvis' PLUM, which looks good on paper, though I wouldn't say it's necessarily something which directly correlates to RoR.
Being a Python hack, I've also been looking at Django which was very recently released and looks promising as well.
So many frameworks/languages/cool stuff, so little time... :)
It's incredible - everybody must be reading the same blogs at the same time. I also saw those posts and was contimplating what it would take to get a rails framework for ColdFusion.
ColdFusion HAS some very nice frameworks that enhance productivity. However, the one thing that seems to come out in any rails conversation is the abstraction of database calls. I've only looked at RonR briefly but it seems that they've got a very slick way of automating getter and setter functions with the DB. It requires a rigid naming convention on the db side in order for the script to find it but it seems that taking care of that plumbing is a big hit for many people.
Another feature that draws ooos and awes is the built in AJAX features. They've implemented some standard AJAX library stuff that developers call from code and it just works. I'd like to see some of this with CF but Flash Forms are 'supposed' to be our RIA platform of choice. ;)
Anyway - what other things does Rails do that we currently aren't getting from our frameworks?
Another CF framework to take a look at as far as "faster RAD" goes is PLUM, by Adam and David Churvis.
Is PLUM a true MVC framework or and code generating ide? I saw their presentation at CFUnited and only ended up confused. And is it really a faster RAD if it only develops a highly specialized (albiet common) sort of site?
It already exists
If PLUM isn't RAD, nothing is.
I was at CFUnited as well. The presentation fell far short of what PLUM can do. I hesitate to push too hard 'cause I need all the competitive advatages I can get.
Do yourself a favor, download PLUM and work through the tutorials.
I consider myself a very pragmatic and agnostic programmer. And although I admit that I tend to prefer open source software for both technical and strategic reasons, I understand that for team X, project Y and client Z, tecnology T might be the best choice both technically and economically, regardless of anything else.
But from a technical standpoint, there's really no comparision between (Ruby|Python) and CF. Having a bit of commercial CF experience myself, I would claim that 70% of the stuff you can only do using components and nasty UDFs in CF, are natively available in (Ruby|Python) *or* can be written in 3 lines of very concise and *readable* code. Plus, of course, there's the obvious advantage of free, open-source software, with a community as strong or as helpful as that of CF.
Also worth checking out Django (djangoproject.com), from the Python guys. Too bad it took the Python community so long to come up with something as good as Rails. I still like Python a lot but right now I've got way too many lines of working Ruby code to switch back :)
Since I was implicated, I think that it's worth chiming in.
I actually was talking to Michael when out in Portland a week ago. We were both pondering about a CF version of Rails as well.
One part of the appeal is the discovery of the database that occurs. I think that this can be done with relative ease although it's not as direct. I've seen some projects that will let you get access to SQL Server and Oracle, but they rely on polling several sys tables. Rails does indeed make use of some relatively strict rules although they can indeed be overwritten.
Another thing that comes "for free" are cleaner, nicer looking URLs.
A third thing I was really interested in is the ActiveMailer which handles all sorts of mail items. Previously, I used iMS Mail Server with CF and while I had control to do all I wanted, it was an expensive route with licensing CF, iMS, and SQL Server.
And that's one of the major points.. licensing. Indeed there's so little to consider. My $7.95 a month account does wonders. We were already running Linux for our mail server and this made it quicker.
I'll compare this to the sometimes painful process I was going through developing DAOs, Gateways, Beans, Controllers and the like. I know I wasn't using a published framework, but even if I was using Fusebox or anything else it would still take a lot longer.
And for background, I've been doing CF for 8 years now. I've taught classes on the matter and made the majority of my income in that time as a CF consultant - so I've been on the CF bus for quite some time and have no problems with CF at all.
So in summary.. Rails is really cool. I would love to see CF on Rails and I think it's very viable. I think a MSSQL tie in would be quite interesting since Rails -> MSSQL seems to only work well when on a Windows box (some driver related thing).
I think the CF community could use something like this to generate a nice bunch of interest from new people.
I actually got started on this a couple months ago but got detoured by other projects at work. I call it "ColdFusion on Wheels" :) And I got an ISAPI re-write engine for IIS to get the REST architecture running.
One of the great benefits of Rails is that you can build a functioning app using helper scripts that write the OO code you need to wrap around the database, as well as the CRUD pages for getting info into the tables. So with 2 or 3 script calls you've got a fully functioning (albeit very bare-bones) web app. You can't get more rapid than that! Duplicating this functionality was the next step in my project.
The problem now becomes writing millions of functions that do everything for you! I've run into a few deadends ... you can't really use custom tags the <cfimport> way because you aren't allowed to use variable names in the taglib= attribute, so I'm using CFCs for just about everything.
I'll have to start that project up again now that I see there might actually be some interest ...
Very cool Rob, yeah keep workin on it... I like the name CF on Wheels too...
I have some code written that uses the JDBC API get database meta data. Though its not totally done. I could contribute that to the project.
This may be very irrelevant, but 'ColdFusion on Wheels' doesn't exactly roll off the tongue. Don't underestimate the power in a good name. 'Ruby on Rails' works because of the alliteration and low syllable count. It's easy to say. If alliteration for a ColdFusion based package seems too forced - 'Cold Cable', or 'Cold Course' there is always 'Fusion Groove', 'Fusion Tracks', 'Fusion Rails', etc that might be a better fit, easier to 'market', etc.
I am glad that I am not the only one who is impressed with Ruby on Rails and wants to see a CF version.
It seems that in the CF world everyone is arguing my framework is better than your framework while the earth is moving beneath their feet.
If the Python, PHP and dotNet communities are building versions of rails, why not CF'ers? I don't mean tacked onto another framework but a ground up port.
Count me in as one willing to help. It has to be a community effort to succeed.
I guess it would be nice to see a CF on Rails but I am not sure. Some of the things you can do in Rails are made possible by Ruby itself and would require some terrible hacking about to make work with CF (for example the ability to create Mixins which are very useful in a Rails app such as mine where I need to create UUID's to insert into the DB).
I grant you it would be difficult if not impossible to emulate Ruby itself in ColdFusion.
I do know of one effort however to replicate active record and that will be a great step forward.
If we want to attract new people to CF we need to not lose the rapid application development lead.
It's official! http://www.cube6media.com/weblog/entry/2005/11/14/coldfusion-on-wheels
Just a quick question about CF on Wheels... So it does URL rewritting..does that mean it only happens in development mode or would my hosting account have to support that?