Most of us that have been around programming for a while have heard the arguments for separating content and layout in our applications numerous times. Likewise, most of us have nodded our heads and generally acknowledged that it’s a “good idea” or something similar. Over the last few days, it’s really hit home for me why this is such a good idea.

Two of the projects I’m working on at the moment have had complete user interface updates in the last two weeks. One is a MachII project I’m working on with my brother. The other is a ModelGlue project I’m working on with another client. In each instance, the decision was made that the template that we were using just wasn’t flexible enough to allow us to easily do what we wanted to so the decision was made to replace it. I’m not talking about a simple color scheme change–both these were radical template changes that changed overall layout containers and content containers as well as the styles for the content elements themselves.

In a traditional, “spaghetti” ColdFusion site like we all wrote back in the early days (what I like to call the “Bad Ole Days”), this would have been a nightmare to do on a site of any size. Granted, these two applications were both small- to mid-sized at the moment, but the amount of work and testing required would still have been significant.

Here’s the real kicker though. Each of these were done in less than 1 man day’s worth of effort due to the way MachII and ModelGlue separate the different parts of the process of generating the final HTML page! That’s just awesome as far as I’m concerned!

So, for those people that use the argument that MVC frameworks are more work than they’re worth except in large, enterprise-class applications, I submit that the first time you encounter this situation, you just might change your mind.

*Disclaimer: I know that there are other MVC frameworks out there for ColdFusion and they solve a lot of the same problems that MachII and ModelGlue do. I only mention these two here because they’re the ones that I worked with directly.

2 thoughts on “What I’ve Learned: MVC frameworks are worth it

  1. I think it’s worth mentioning that these frameworks – Model-Glue, Mach II, etc. – often do much more than create MVC architectures. If one wanted to create MVC without a given framework, you would still get great benefit, even if you didn’t have all the additional features provided by the established frameworks.

  2. @Ben That’s a really good point. The popular frameworks today have had several revisions to add lots of neat features that aren’t strictly MVC related. I also agree that you would still benefit from a well-designed MVC of your own making. My two main concerns with home-spun frameworks are

    a) most projects don’t need a custom-designed framework (but for those that do it’s certainly a better option than trying to bend one of the popular ones to your particular will) and
    b) maintainability for other developers coming in to the project later (and to some extent for the person that originally wrote the framework if there’s a time lag between creation and maintenance efforts)

    So, while I can envision that there are times when creating your own framework, I would suggest some very in-depth discovery to make sure that’s the right way to go for a particular project before taking on the task vs using an established framework.

Leave a Reply

Your email address will not be published. Required fields are marked *

*