Wednesday, 31 July 2013

When to use AngularJS and when to use Backbone!

In this post I am documenting my thoughts on when to use Backbone vs AngularJS with the help of examples (This post is not a comparison between AngularJS and Backbone).

E-Commerce Application

It should not be a single page app (unless we are trying to address few small use-cases or building shopping site for a small merchant). 

We need a framework which provides support for data-binding. Struts OGNL, Spring MVC, JSF EL etc work fine but these are backend technologies. For a modern web-app we need similar support using JavaScript. AngularJS from Google offers this kind of functionality and hence recommended. 

Online HTML/CSS Builder 

Edit functionality becomes more important than view/read. It should be a single page app (User experience is good in this case). 

A lot of UI specific work involved - like drag n' drop, animation effects etc. Text rendering is limited. AngularJS can be used to create a SPA but Backbone is recommended.

Interactive Reporting Tool

Dynamic UI, report editing and cool UI effects. Backbone is recommended. Please not that Backbone alone is not sufficient so we must use a suitable js-tech-stack which is known to work properly with Backbone.

Content Management System

Data representation in TEXT format. Edit functionality using regular forms. 
Single Page App with content getting managed in various Views. AngularJS is recommended.

Question - What will I use if I have to build GMail? 
Answer - AngularJS :)

* In most of the projects where I use Backbone, I define proper architecture for the JS layer, design with the help of a complete js-tech-stack and let backbone play its role (I do not let backbone drive the architecture of front-end).

No comments:

Post a Comment