Backbone.js is a lightweight JavaScript framework that provides structure to web applications through models, collections, views, and a RESTful JSON interface. It allows separation of data from presentation through models that handle data synchronization with a backend server, while views listen to model changes and update the HTML. Backbone.js gives structure to applications in an MVC pattern through core classes like Model, Collection, View, and Controller. It is well-suited for creating front-end heavy, data-driven applications.
Convert to study materialsBETA
Transform any presentation into ready-made study material—select from outputs like summaries, definitions, and practice questions.
2. Their scopes and use cases are pretty different and because you know one doesn't mean that
you shouldn't learn the other. As a JavaScript developer, you should know how to effectively work
with both.
Where should I be using this?
Backbone is ideally suited for creating front end heavy, data driven applications. Think the GMail
interface, new Twitter or any other revelation of the past few years. It makes creating complex
apps easier.
While you can shoehorn it for more mainstream web pages, this is really a library that is tailored
for web apps.
I can still use other libraries on the page, right?
Absolutely. Not only your typical DOM accessing, AJAX wrapping kind, but also the rest of your
templating and script loading kind. It's very, very loosely coupled, which means you can use
almost all of your tools in conjunction with Backbone.
Answers from Stack Overflow
1.
Backbone.js is basically an uberlight framework that allows you to structure your Javascript
code in an MVC(Model, View, Controller) fashion where...
Model is part of your code that retrieves and populates the data,
View is the HTML representation of this model(views change as models change, etc)
and Controller that in this case allows you to save the state of your javascript application via a
hashbang url, for example: http://twitter.com/#search?q=backbone.js
Some pros that I discovered with Backbone:
● No more Javascript Spaghetti: code is organized and broken down into semantically
meaningful .js files which are later combined using JAMMIT
● No more jQuery.data(bla, bla): no need to store data in DOM, store data in models
instead
● event binding just works
● extremely useful underscore utility library
● backbone.js code is well documented and a great read. opened my eyes to a number of
JS code techniques.
Cons:
Documento creado por Francisco Quintero