Andrew Powell

Into The Mind of A Solutions Architect

Andrew Powell

Should CFML Developers Switch to Java or Decaff?

May 12, 2008 · 1 Comment

Note:  This started as a reply to Brian's cf.Objective() topic, but I felt it deserved its own post.

OK, so we know ColdFusion (as Joe has said) makes it "stupid-easy" to render HTML off of dynamic data.  We (CFML developers) have been using it to do this for years.  Only recently, with the fast emergence of RIAs in the last 5 years, has the game changed.  My personal approach has become to to let ColdFusion do what it does best, and no more.  No AJAX generation or any of that silly UI stuff.  Leave that to the AJAX frameworks, or Flex, or whatever your UI is going to be on the front-end.  That's what the UI tool was designed for, CF wasn't.  Let CF focus on three things:  Getting data into and out of RIA front-ends, rendering HTML with dynamic data, and providing services that Java and .Net cannot provide (more on that in a bit).  Beyond that, let Java, .NET, or whatever do the work at the model layer.  Keep your CFML to a minimum and give ColdFusion some room to breathe.

This is not to say I don't use CFCs.  I do.  My framework of choice (Mach-II) relies almost exclusively on CFCs for processing requests.  However, the only CFCs I have in my application (outside of the framework) are for listeners, plugins, and filters.  No more, no less.  The rest of the work is done at that Java layer.  Spring handles my IOC and AOP, and Hibernate is responsible for my persistence.  No more, no less.

This approach solves much of what the "vocal minority" at the cf.Objective() CF 9 BOF were clamoring for:  You get the best of both worlds.  You get all of CF's ability to deliver data and render that static UI, plus kick-ass services:  CFMAIL, CFPDF, etc that you cannot and never will be able to do easily in Java (my OO lang of choice).  You also get the things that Java does well:  strong-typing, easy persistence (Hibernate), strong IOC utils (Spring), a true OO language, plus a ton of other stuff that CFML & ColdFusion just don't do well as Java.  

I think that there are some CFML developers who are not necessarily "outgrowing CFML" as Brian has put it, but learning that there are other tools in the tool belt besides your favorite hammer.  Is that so bad to realize and use those other tools?  I don't think so.  I think it's a natural progression of the good developer to push themselves to, occasionally, learn other languages and not be complacent with just one language.

So, should CFML developers switch to Java?  No.  Should they learn it and learn how to leverage it within their CFML apps? Absolutely.  It gives you the ability to let ColdFusion run and truely perform, plus it gives you, the developer, another skill that will make you that much more marketable.  It truly is a win-win situation.

Tags: Java · ColdFusion · Flex · General · Spring · Adobe

1 response so far ↓

  • 1 James Netherton // May 15, 2008 at 9:39 AM

    Good post and I agree with your conclusion. <br /><br />Recently, I've come across a number of companies that are refactoring their CF applications to a Java Spring &amp; Hibernate architecture, whilst leaving CF to provide the front end as well as other services. <br /><br />It's something I've been looking at quite closely for a while too.

Leave a Comment