
It's easiest to call Backbone.js a member of the MV* family. But it doesn't quite fit into an MVC pattern, or MVVM pattern, or MVP, or anything else. It provides a set of objects that help to organize models and views, after all. Backbone.js fits within the Model-View- MV family of patterns quite clearly. Looking beyond the individual pieces of Backbone.js, there is some debate about what to call it from an architecture and patterns perspective. For a high level overview and for most applications, though, these six objects are the most important. There are other small parts of Backbone.js, still, that become important to understand if and when they need to be customized. Routers and the History object allow an application state to be bookmarked or linked, reloading the page to exactly the place where it was left.
#Backbone js each code#
What is Backbone.js?īackbone.js is a library of components that helps developers add structure to JavaScript code in Web applications. You can combine the simplicity and interactivity of jQuery-based applications with the building blocks of good structure from Backbone.js to create highly interactive pages that also have good code organization and structure. The good news is that you don't have to choose exclusively between jQuery and well-structured code that SPA libraries and frameworks help you to write. The truth is that jQuery does not provide any guidance on organization or structure for code. It is very easy to get lost in a Christmas tree of doom – a deeply nested list of callback functions that seems to hold every single feature and interaction.


One of the difficulties in building large jQuery applications is keeping code organized. The interactivity provided by jQuery can be easily augmented with plug-ins and add-ons to create further interactions. Many developers choose to write code with nothing more than jQuery when they don't need a complete SPA framework, and with good reason. You don't need a complete MVC framework just to add form validation, for example. With a reduction in functional requirements for smaller pages, there is also a reduction in the list of appropriate frameworks and libraries for building the page. For these pages, there is a need for a high level of interactivity without the need for client-side routing and other SPA features. A lot of applications are better suited to a smaller scale of functionality. They help usher in a new era of Single Page Applications (SPAs), creating an unprecedented level of interactivity and usefulness on the Web.īut not every Web app or every page on a site needs to be built with a SPA framework in order to be interactive.

These libraries and frameworks make it easier to build very complex and powerful applications in a browser. Libraries and frameworks, such as Backbone.js, Marionette.js, Ember.js, and Angular.js are popping up and growing quickly in both popularity and features. JavaScript is more important than ever for building highly interactive Web applications.
