Before I start I want to make a reference to an article that describes the principles in modern web (http://blogs.atlassian.com/2012/01/modern-principles-in-web-development/):
- Designing for mobile first (even if you’re not building a mobile app)
- Build only single page apps
- Create and use your own REST API (for building good web/restful APIs I strongly recommend reading this article http://www.infoq.com/news/2012/03/web-api-design-book and the very short ebook you can download by following the link in the article, also here at http://offers.apigee.com/web-api-design-ebook/)
- “Sex sells” applies to web apps
Traditional web frameworks
For traditional web frameworks I recommend looking no further than at the comparisons from Mat Raible’s blog. He creates a new comparison every few months and is very well know in the field as an expert.
His last blog on this topic is here http://raibledesigns.com/rd/entry/comparing_web_frameworks_and_html5 and has Grails (groovy language, inspired from Ruby on Rails and based on Spring MVC), Spring MVC (Java) on top, followed closely by Ruby on Rails, Play (Java and Scala with no server side state) and even GWT (Java to JS).
If you followed my previous blogs you can probably figure out I prefer newer languages to Java because of how much code is needed to write any simple Java code compared to any other new language. The fact that all these frameworks can run on the JVM (even Ruby as JRuby on Rails, but not GWT, as that will run as JS), it still allows you to use your existing Java code or other libraries if needed and not have from scratch.
I prefer stateless apps that are single page and expose RESTful APIs (I’m not convinced on being pure REST) and that have their own dedicated data sources (any combination of RDBMS, document stores, search indexes or data grids and distributed caches).
We all know about jQuery, Ext-JS, Dojo, etc. They are all good frameworks I I think it will be hard to develop any JS based UI without some jQuery, so that’s a given, but for a real app the code will soon become a mess and here is where a JS MVC framework can help.
Backbone.js is not new, but you can’t go wrong with it. On the bad side, it is not as lightweight as other frameworks, like Agility.js (this is a very lightweight framework that I recommend as a good and very simple starting point).
Some JS MVC frameworks come with their own template support, like Backbone that has Underscore and the template support in Underscore.
This article compares the template frameworks http://engineering.linkedin.com/frontend/client-side-templating-throwdown-mustache-handlebars-dustjs-and-more and the top 5 are: closure, mustache, handlebars, dust and underscore. Like with any framework, try out 2-3 and see for yourself which one fits with problem and personal style better. Some people combine mustache with handlebars (for a perfect look 🙂 ).