A Brief Introduction of Backbone js

Posted By : Aastha Rawat | 29-Nov-2018

What is Backbone.Js?

 

Backbone is a lightweight Javascript framework and it is used to build single-page web applications and allows you to make your code in a structured and modular form if you are working with a team and also It allows the user to reuse the code. It is based on the Model-View-Controller pattern. It is used for creating single web page applications using a RESTful service for persisting data. It has a hard dependency on underscore.js and a soft dependency on jQuery. 

 

What will Backbone Provide

 

Model: Models in Backbone represent data. It offers a way to organize your domain-specific code. It retrieves and populates the data and whenever the model is updated, it fires an event and the view tied to that object or data to the model. The view listens for events and re-renders itself.  

 

View: View is the HTML representation of this model. All functions that updated the DOM or listen for DOM events go here. Each view is secured with a particular part of the DOM. For eg. If you have logginFormView, that will only listen to the login form and if you have paymentOrderListView, that will only display the payment order list. It attached to particular models or collections. whenever the value of model gets updates, it fires an event from which the view listen to. the view listens and re-renders itself.

 

Collections: It is simply a group or store lists of models or collection of models. Like models, collections fire events whenever things updated. Whenever the model is removed or a new model is added to a collection, a change event is fired. A view can listen to a collection and updates itself whenever the collection updates.

 

Events: It is a module that can use with any object, giving the object the ability to bind and trigger custom named events. They do not have to be declared before they are bound, and may take passed arguments.
In this simple terms, every time when an object wants to alert the same object, it can dispatch the alert event and the other objects that are bind to this event that responds in however they want. 

 

Router: It provides methods for routing the client side of the web app and manages it with actions and events. They are responsible for navigation.

 

Thanks!

About Author

Author Image
Aastha Rawat

She has a skilled to combine the art of design with the art of programming. She has a good knowledge of HTML 5, CSS, Photoshop, SASS, JavaScript, BackboneJs and apart from this she is creative and hard working .

Request for Proposal

Name is required

Comment is required

Sending message..