An Architect's View

CFML, Clojure, Software Design, Frameworks and more...

An Architect's View

Which Framework?

February 15, 2006 ·

In the last few weeks I've been receiving an increasing number of questions asking "Which framework should I use?". Sometimes there's quite a bit of background about the application to be built and / or the skillset of the developer(s) involved. Most often there is little or no background info. For example:
I just want to know your thoughts on this question... Which is the best Framework you think to adapt? (Fusebox or Mach II)
Even assuming they mean "adopt", it's certainly not a straightforward question. I'd recommend folks download my frameworks comparison presentation and take a look at the accompanying sample application code. This covers Fusebox, Mach II and Model-Glue and gives pros and cons for each framework as well as some broad recommendations based on your skillset and the type of application you want to build. The sample code has nine variants of a single application, showing various flavors of Fusebox, Mach II, Model-Glue, Tartan and ColdSpring in various combinations. I'm currently running around CFUGs with a talk about "Objects & Persistence" that briefly covers four of the ORM frameworks that have appeared lately: Arf!, objectBreeze, Transfer and Reactor. I'll soon also be giving a talk about factories and covering ColdSpring. Both of those talks will be accompanied by more variants of more applications. However, I get the impression that some of the people asking me this question want me to specifically recommend a framework or a combination of frameworks for them so they don't have to digest the presentation and code. The short answer is that there is no "One True Answer™". Here's part of another email - which has a lot more background the question - but here's how the question was phrased:
Anyway, I'm looking for some guidance with frameworks. I am involved in a project that I know could benefit from using a framework. I just don't know which one would be best. The more I read, the more confused I get. I think I've narrowed it down to Fusebox or a Model-Glue / ColdSpring / Reactor set up. I really like the MVC concept, but am new to that as well, so I'm not sure if it would be easier to go with something that forces the implementation or trying to implement Fusebox in an MVC pattern.
This person has done their research and understands some of the tradeoffs involved which is great as far as I'm concerned. I sympathize with this part "The more I read, the more confused I get." - it's not a simple choice. They will get a long, detailed response - as soon as I find time. The other email shown above will get a short recommendation to read my presentation and look at the sample code. The point of this (somewhat long) blog entry is that if you want me to offer advice on the choice of frameworks, I'm more than happy to do so - but the quality of the answer you get will be directly proportional to the amount of information you provide me with (and the amount of "homework" you show you've done). And yes, I do have a personal preference - if there is no overwhelming reason to use a different specific framework combination. Just remember that what works for me might not necessarily work for you. What is my personal preference? Don't read too much into someone's personal preferences...

Tags: architecture · coldfusion · programming

8 responses

  • 1 Jehiah // Feb 15, 2006 at 7:51 PM

    I think when faced with situations like that you need to realize that if you can't make up your mind there is no clear "wrong" choice, and you just need to jump in with both feet. Pick the one that looks easier to start working with, and be willing to realize that by using it (or trying to) you will find your answer. If you end up refactoring your code later to fit the other framework chalk it up to a valuable homework exercise.
  • 2 Sean Corfield // Feb 15, 2006 at 9:09 PM

    Very true! If you're at the point where you are ready for a framework, then the actual choice of *which* framework is, in many ways, less important than the decision you've already made to use *a* framework...
  • 3 Joe Rinehart // Feb 16, 2006 at 3:58 AM

    Hey Sean,

    Nice post - I think it's very important to stress that there is no One True Answer for all situations. As a case in point, I've recommended moving towards MVC Fusebox on a number of times for situations where folks are still getting their feet wet with CFCs, even though my personal preferences are fairly obvious.

    Aside: might want to put change "alert('Model-Glue, ColdSpring, Reactor');" to "alert('Model-Glue, ColdSpring, Reactor');return false", it reloads the page as-is.

  • 4 Matt // Feb 16, 2006 at 8:36 AM

    Although I have not emailed Sean, I am one of those type of people trying to figure out the best framework/methodology to rewrite an app. I did review (and still refer to) Sean's presentation and sample code.

    I first dove into Fusebox as it seemed well-suited to a framework newbie. However, I have read and learned a lot about OO so I wanted to do the MVC thing. I found Fusebox confusing as I wasn't sure which circuit.xml file should hold what fuseaction: the model\circuit.xml, the view\circuit.xml or the controller\circuit.xml (which had no other files in it).

    So now I am attempting Mach II. I like having only one configure\mach-ii.xml file to keep things straight in.

    The other struggle is not so much framework related, but OO related (I come from the typical spaghetti/procedural lineage). What objects should I create and when and where? How much abstraction should I use? How do I know if my object design is loosely coupled and highly cohesive? What is my name? Why did the chicken cross the road? aaaaaaahhhh!

    Thanks for letting me get that off my chest.
  • 5 Doug // Feb 16, 2006 at 9:17 AM

    Hi Matt, Am in the same boat you are and have found that the book 'Head First Design Patterns' published by O'Reilly is helping me.
  • 6 Sean Corfield // Feb 16, 2006 at 7:43 PM

    Joe, thanx, I drew a complete blank on how to prevent the link doing anything... blame the copious cold meds I'm on!

    Matt, yes, the hardest part of using Model-Glue or Mach II (or even MVC Fusebox with an OO model) is figuring out the object design. Experience is probably the only sure-fire way to learn that but *some* books help *some* people (in the same way that *some* training courses help *some* people). It's tough stuff, unfortunately.
  • 7 Peter Ladage // Feb 18, 2006 at 4:05 PM

    sean, thanks for the excellent overview of frameworks. it confirms our choice of MVC-Fusebox as right for us as we prepare to move beyond CF5. like matt, our background is spag-procedural code, and none of us has very much CFC or OO experience.

    i agree that the right answer is *any framework* is better than no framework, and research and diving in will tell you which framework is most palatable. however, once the choice is made, how locked in are we to using MVC-FB, if, as our skills grow, we want use the power of OO that other models offer?
  • 8 Sean Corfield // Feb 18, 2006 at 5:44 PM

    Peter, using MVC-FB lets you migrate your model over time to a full OO model. You can use Tartan and ColdSpring with MVC-FB (although I intend to make that slightly easier in Fusebox 5 by adding per-application initialization hooks).