More Apps, not Frameworks! But, should you use a Framework for your Apps?

{ Posted By : Eric Cobb on May 2, 2011 }
2319 Views
Related Categories: Ramblings, Frameworks

Right after the OpenCF Summit earlier this year, I read a few blog posts in which people mention the topic of "More Apps, Not Frameworks" (or something along those lines). If you haven't heard about it, this is basically the idea that CFML already has enough solid frameworks out there, and we don't need any more. What we need are more free, open source CFML apps that can help spread the use of CFML. Now, I'm not here to argue or debate whether or not we need more frameworks or not, the point of this post is to simply ask one question. If we do start building more and more open source CFML applications, should we use frameworks for those applications?

I've come to like frameworks. Specifically, I like to use Mach-II, and I've dabbled with FW/1 a bit. I see the value in using frameworks, and personally plan on using a framework on my projects whenever I can. But not everyone feels this way. There are people who are dead set against frameworks, and won't have anything to do with them. They've got their reasons and that's fine. I don't have a problem with whether or not someone uses a framework, to each his own, you can do whatever works better for you.

But, I can't help but wonder, would using a framework on an open source application actually serve as a deterrent to the adoption of that application? My initial reaction is "No", but as I think more about it I'm not so sure. Would people who need and want your application decide not to use it because you used a framework and they don't like frameworks, or because you used Framework A and they like Framework B?

Take a CMS for example. Let's say we have a CMS built using Framework A and it's a great application, it can manage content like nobody's business. But Bob the developer doesn't like Framework A, he's a die hard Framework B junkie. So, rather than use the application built on that piece of crap Framework A (Bob's words, not mine) Bob decides to build his own CMS using his beloved Framework B and put it out there as an open source application. Now we have two CMS applications built on two frameworks. That's fine, variety is good. But then we have Bill the developer who hates all frameworks, and decides to write his own CMS rather than use one of the already established CMS applications. Now we have three OS CMS applications. But wait, Framework X is new an hot and generating some buzz, so someone builds a CMS on it. And this pattern goes on and on and on until we have a dozen different CMS applications on a dozen different frameworks.

So in the above example, is there really anything wrong with that? We now have a large selection of CMS applications to choose from, and that's a good thing right? What happens when someone new to CFML gets overwhelmed and asks the community for advice on which one to use? Will they get reviews of the different CMS applications, or a bunch of "I like this one because it uses my favorite framework" or "use this one because it doesn't use a blasted framework" answers? What happens when people find several open source CFML applications that they need, and each application uses a different framework? Now they have to download another framework to go with each app. You could easily wind up managing 4 or 5 applications written on 4 or 5 frameworks.

I guess it really doesn't matter, when it's all said and done you're not going to be able to write an application that everyone likes, no matter what you use. Despite my ramblings above, I say "yes" to the questions of whether or not to use a framework on OS applications. But, I still want to post the question to the community: What is your opinion, should we use frameworks when building open source applications?

Comments
Raymond Camden's Gravatar For the most part, I shied away from using frameworks in my OS apps not because of fear that someone may not like the framework, but because of the additional work involved in setting it up. I get reports about once a month from folks who have issues with LHP for example because it uses Model-Glue and ColdSpring.

For apps where I can drop support for CF < 8 though I'd probably just ship the framework and use an App.cfc mapping (and document in case folks want to use their own copy of the framework).
# Posted By Raymond Camden | 5/2/11 11:33 AM
Scott Stroz's Gravatar I think if a framework adds to the project or makes it easier to use, then absolutely, use one.

I wonder how many developers in other languages would refuse to use an OSS project because they did not like one of the components used in writing it.
# Posted By Scott Stroz | 5/2/11 12:36 PM
Travis's Gravatar I was thinking something similar. I wouldn't use a framework because, in my mind, it just causes more of an issue to maintain and configure; especially if the app ever gets fragmented.

As far as your example... I think that would more lend itself to the community wanting to contribute to A vs. B vs. C because of the framework used. I would suspect average programmer Steve would use the version that worked best for him. Then again, if people believe in the idea it won't matter if/what frameworks are used.
# Posted By Travis | 5/2/11 12:41 PM
Lola LB's Gravatar Okay, then, what is the point of having frameworks? Exactly what problems do these solve? And what kind of OSS applications would be better off not using frameworks?
# Posted By Lola LB | 5/2/11 1:50 PM
Raymond Camden's Gravatar To me, frameworks typically solve the organization/structure issue. Ie, I don't have to worry about where things go and how things are processed. That sounds simple, but it's amazing how much of a help it is when I can hand off that responsibility to a framework. Also by being able to more easily make use of a MVC design, I can better architecture my apps.

A framework basically handles EVERYTHING but the actual business logic. It clears away all the grunt work and lets me focus on the "real" work. That's significant.
# Posted By Raymond Camden | 5/2/11 1:55 PM
Jason Dean's Gravatar If I was writing a large, OSS App I would definitely use a framework. And I would bundle said framework into the application so that it worked out-of-the-box.

I would probably try to put in config so they could point to a different version if they wanted to, but I would make framework updates part of the app update and continue to bundle.
# Posted By Jason Dean | 5/2/11 1:57 PM
Eric Cobb's Gravatar @Ray - I can see where requiring a framework for an app would cause some trouble on the setup end, especially if the person who was installing the app wasn't a very experienced developer. I too had considered just shipping the framework with the app.

@Scott, funny you mentioned it, I almost put something in the original blog post about wonder how other programming communities handle this situation.

@Travis - yeah, that's one of the drawbacks I think with shipping a framework with your app...maintenance, configuration, versioning, etc...

Honestly, I can see it from both ends. From a developer's perspective using a framework would really help keep everything in line, especially on an OS app where there may be dozens of developers from all over the world contributing to it. In fact, I think a case like that is where a framework would truly shine, it's what they're made for. But, from the deployment and maintenance end of things I see where it could be tricky.
# Posted By Eric Cobb | 5/2/11 2:07 PM
Joshua Cyr's Gravatar An interesting question. Personally I don't think it matters either way if the goal is having OS apps that help spread the word of and use of CFML. Those apps that really take off, and help propel the use of CFML do so not because of any code, framework, etc. They do so because they are great apps.

We few who may have opinions on the code level may care (or not) but the masses really just want something super easy, functional and near instant to get started with. When we are at the point where people can pick CFML OS apps on a whim to try out, and don't care about the underlying tech, that will be a great thing.

When making the next app, use the framework you are most excited about to help get that app done and in the hands of actual users. Or use that framework you have been curious about and really want to get your hands on. Or make a new one. Not that I want to start a discussion on making new frameworks, but if the mantra for no new frameworks was just a year earlier we wouldn't see fw/1, which would be a shame. :-)
# Posted By Joshua Cyr | 5/2/11 2:08 PM
Eric Cobb's Gravatar @Joshua - that's actually a really good point. I was looking at this from a developer's point of view. I hadn't really considered the average Joe who doesn't know or care about the underlying tech. Thanks!
# Posted By Eric Cobb | 5/2/11 4:09 PM
Sean Corfield's Gravatar It's definitely a reasonable question to ask. Imagine your OSS application turns out at 10,000 lines of code. What does that look like if it's 10,000 lines of code + one or more frameworks? ColdSpring is 6-15k depending on which version you use (and exactly what folders you count). ColdBox is ~30k. I don't know how big Mach-II and Model-Glue are these days. I can definitely see someone being concerned about having their OSS app depend on a particular version of a specific framework, esp. since all of those mentioned assume component paths (and therefore mappings in the Admin if their Application.cfc extends the framework; otherwise per-application mappings).
# Posted By Sean Corfield | 5/2/11 8:27 PM
Michael Heffer's Gravatar @Eric - Good topic. I think it really depends on the size/complexity. There are times where a framework makes life so much easier, and decreases your lifecycle maintenance costs. There are also times when it doesn't make sense because the application is simple enough (not worth inheriting the overhead).
When it comes to OSS, I don't see why the reasoning should change. If you understand the theory, then it shouldn't be difficult to parse through a particular framework and figure out how to tweak whatever application you are using. And if it is a framework you haven't used before, then it gives you an opportunity to learn something new.

If you aren't going to make changes to the source code - then why would you care what framework (if any) was used. But if you are going to make changes...

@Ray brought up a perfect example. I downloaded LHP and was forced to figure out Model Glue pretty quick in order to make some changes. But guess what? The fact that the application was using a framework allowed me to quickly grasp the architecture, find what I needed to, and make the required changes. It is even possible that had a framework NOT been used, it may have taken more time to modify. One thing is for sure though, having a framework in place made me feel as though my modifications would be well received (not cause unforeseen bugs elsewhere in the application).

In summary, if any application (open source or otherwise) is complex enough - then using a framework (don't care which one) is probably better in my opinion.

@Scott did a great presentation on CFMeetup where he developed a model and then used it within multiple frameworks.

http://www.meetup.com/coldfusionmeetup/events/1499...
# Posted By Michael Heffer | 5/3/11 10:27 AM