Backbonejs Introduction

 

What is Backbone.js

Backbone.js is a JavaScript library with a RESTful JSON interface and is based on the model–view–presenter (MVP) application design paradigm.

Backbone.js is a popular open source JavaScript framework that allows us to develop single page web application.

BackboneJS is not a framework but a library.

BackboneJS is Created by Jeremy Ashkenas, the JS ninja who built CoffeeScript.

Backbone is a super light-weight library that lets you create easy to maintain front ends. It’s backend agnostic and works well with any of the modern JavaScript libraries you’re already using.

Backbone is a collection of cohesive objects, weighing in at a shade under 4kb, that lend structure to your code and basically helps you build a proper MVC app in the browser.


 

BackboneJS Functions:

Backbone.js has these main functions:

  1. Create models (and collections of models)
  2. Create views
  3. Manage bindings and events that allow modular use of different models or views with other pieces of the framework.
  4. Make use of the observer pattern on the models, so views can directly listen to any changes that happen to a model and automatically update that view to reflect the changes
  5. Built in support for jQuery or Zepto for DOM manipulation

 


 

Advantages And Disadvantages Of BackboneJS:

Advantages:

  • 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.

Disadvantages:

  • Took me a while to wrap my head around it and figure out how to apply it to my code, but im a Javascript Newb.

 

Leave a comment