Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a web app I would like to gradually refactor by adding structure to it.

I have narrowed down the options to Backbone (with some plugins), Ember.js and AngularJS

My goal is to refactor that app, which has the usual jQuery spaghetti and gradually add some structure to it.


  • not a "all or nothing" framework, e.g. allow gradually moving code from "before" to "after" without rewriting the app from scratch (winner - Backbone?)
  • something that has a future, people seem excited about and has a big company behind it (Angular takes this bullet)
  • Let me sometimes do things "my way" and not force a paradigm (Backbone a clear winner here)
  • Something that will really boost my productivity and remove the need for boilerplate code (Angular + Ember)
  • Something that is good not just with the obvious things, but also the complex things, e.g. animation transitions, nested models, handling modal dialog views, drag and drop support, widget system etc

One option is to become an advanced developer in all 3 and then, the other is to ask people who did something similar

I know that with Backbone I can do everything I want, but I want to know if I'm not to "careful" and wonder if I'm not missing out by not taking the risk of using AngularJS / Ember.js


So my specific, answerable, constructive (as much as I could) questions are:

  1. Is Angular / Ember able to support drag and drop without bending over backward?
  2. Can either of these frameworks support animation transitions well?
  3. Which of these 2 frameworks is easier to "add in" gradually and not to fully rewrite things "their way"
  4. Which of these has better support for NoSQL /document based models as in MongoDB like documents (e.g. a JSON doc rather than a relational model)
  5. Which of these has better built in support for complex models (similar to #4)

Both Ember Data, and Backbone-relational seem to come from a relational database paradigm, and I wonder if there is anything that can build a model from an arbitrary multilevel / nested tree like structure without having to define a NoSQL model in a relational like data structure (e.g. hasMany, belongsTo instead of just a JSON like document).

Also I don't want to stop using JqueryUI because it's not 100% done the "Ember way" or the "Angular way", is Backbone really my best option? Are the nice bells and whistles that come with Angular / Ember are in a trade-off with flexibility?

Is it a good architectural choice to use either Angular or Ember when refactoring an existing jQuery callback pasta in a gradual, iterative approach?

share|improve this question
I suggest that you spend a few hours knocking up a basic application with each framework. This will answer all the questions you have, and as an added bonus will give you insight into which framework you find more comfortable to use. –  Robert Harvey Mar 28 '13 at 14:43
Awesome question, by the way. Well-informed, well-researched, and very thoughtful. –  Shotgun Ninja Mar 28 '13 at 14:46
@RobertHarvey - I know, and I wish I could, I have a rare window of 1 week dedicated to refactor (it's a side project, non profit, and I have a wife and kids) so time is of the essence. All of the things I mentioned are advanced features, I've seen almost any Backbone tutorial (free or paid) as well as AngularJS and even the new Ember.js 1.0 release candidate, to get to a level I'm acing the framework enough to know if it would be a bad choice for my needs or not, I just need more time... –  Eran Medan Mar 28 '13 at 14:47
To voter to close - why too localized? modern SaaS apps are build on the client side, the leading frameworks are BB, Ember and Angular, gaining huge momentum, and almost every SaaS app out there will have some animations, complex data models (NoSQL is gaining momentum for SaaS apps over SQL) and Modal dialog as a view. This question is what I hear from any web developer out there that has a "legacy" jQuery nested callbacks app with tons of DOM manipulation, this question I think is relevant to any web developer out there in the next 2-3 years if not more. May I request an explanation please? –  Eran Medan Mar 28 '13 at 14:53
@ShotgunNinja - thank you! –  Eran Medan Mar 28 '13 at 15:02
add comment

1 Answer

I think your question is missing a critical constraint, but you address it within the comments. Specifically, how much time do you have to invest in this refactor?

Time allotted is going to be the trump card requirement and renders your detailed questions a bit moot.

For this current refactoring window, you've been allocated one week. That's really not enough time to learn a brand new framework and complete meaningful refactoring for even a modest project. Adding in your outside time constraints, and you have perhaps 40 to 50 hours to apply.

That limited timeframe means you need to pick the framework you're most comfortable with now. Based upon your description and research, Backbone is the front runner for selection.

Yes, you may be "missing out" on some neat new feature of the other frameworks. Presuming that all three frameworks are "live" and still being developed, you're going to see that "lacking-feature" difference regardless of the framework you pick. The frameworks will keep moving forward even if you can't keep refactoring your project. Part of any design is to eliminate potential paths to follow so you can focus your top choice. An inherent part of that path elimination is that you will be missing out on feature XYZ that only the less attractive framework has. But that gets us back to time being your overriding constraint.

I would encourage laying out a prioritized list of areas that are going to be refactored. You need to include verification activities along with that refactoring, and I would encourage allowing for some schedule slack to handle the unexpected issues with conversion.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.