Backbone.js gives structure to web applications by providing models with key-value binding and custom
events, collections with a rich API of enumerable functions, views with declarative event handling, and
connects it all to your existing API over a RESTful JSON interface.
6.3kb
Packed and gzipped !!
BackboneJS Constructs
Model (and Collection): Application (domain) data objects that are retrieved from and
persisted to the server
View: HTML presentation of the data stored in the models and DOM 'controller'
Router: Controller that saves the state of the application via a url hash
History: Global router (per frame) to handle hashchange events or pushState
Events: Module that can be mixed in to any object, giving the object the ability to
bind and trigger custom named events.
Sync: Manages actual persistence by a "function that Backbone calls every time it
attempts to read or save a model to the server."
How to map Backbone to MVC
Model
var CallItem = Backbone.Model.extend({
urlRoot:"/call"
});
var myCall = new CallItem();
mycall.save({
name: "Leia",
phone: "1-213-345-2343",
call_on: "2013-03-10"
});