If you write code for a living, then the “Which framework do I use?” question arises fairly often. I have been slinging code for over 13 years and it seems like I need to answer this question every month. The real question we should all be asking ourselves is “Do I need a framework?” If you are doing work as a consultant, you may have different questions than if it is a permanent position. In the java world, this becomes an interesting question because there are multiple versions and the same can be said for .Net. So, when do you need a framework and when do you decide to roll your own? Ask yourself the following questions.

  1. What is my target compile and deploy version? In the java world it is very common to have a target version of 1.2. This reduces the number of java frameworks that you may use. This is quite typical of many corporate environments as they take much longer to upgrade various parts of their IT infrastructure.
  2. What functionality do I need at the minimum? If you do not need much functionality, it may not be worth the time to even research frameworks. As a consultant, I saw some firms do a full month-long framework evaluation when they only needed a servlet filter.
  3. Are there “bonus” features that a framework may give us? Some frameworks are large enough to have many more features than you are immediately looking for. Spring is a perfect example of this. You may be looking at Spring for the dependency injection portion, and as a bonus you pick up the MVC features in the framework.
  4. Do we have any knowledge of the framework? In some shops, this is the most important question to ask. If there is no knowledge of the framework, you will spend a lot of time researching its capabilities instead of actually using it. The amount of time spent maintaining code written to use the framework is also much larger than normal.
  5. What is the cost of knowledge gathering and research for the framework? This is a question for the managers reading this post. If the developer needs a month to research the frameworks and determine their suitability, then that is very expensive. This cost is increased when you realize that mostly senior level developers are going to do the evaluations.
  6. What is the cost of developing an internal framework that does the minimal feature set? If you do not need a lot of functionality, is it “simpler” and “cheaper” to roll your own? In many cases you can have a senior level developer design the framework and get help from junior developers for implementation. This also adds to the internal technical knowledge of the team.
  7. How active is the framework community? If you have a question on how to use something, the community forums or blogs of interest are invaluable. If there is a framework user mailing list, look at how many messages are posted and how quickly responses appear. This is your development support team, so you need to have fairly quick response.
  8. Are there consultants readily available if you hit a roadblock? Sometimes companies will have specific expertise in a framework. If the framework is popular, then many consulting firms will have someone with some level of knowledge.
  9. Are there time constraints on the framework decision? Do you need a choice yesterday? If there is little time to make a decision, popularity of the framework becomes important. Popularity will typically give you the answers to a few of the other questions in this list. Also, smaller frameworks are normally simpler and quicker to integrate into your code.
  10. Would multiple smaller frameworks or various best of breed fit better than one monolithic framework? Some people get concerned with a monolithic choice like Spring or .Net. There are a wealth of frameworks available and some have very targeted functionality. For example, SiteMesh is a small framework that allows you to “skin” your website very easily. You can setup a SiteMesh example site and understand what it does within an hour.

What did I miss? Are there any other questions that you think are important?