

Events – enables to extend any object with event handlersĮach of the objects comes with its own APIs which enables many common development tasks.Routers – expose client-side routing mechanism.In its core, Backbone.js includes five main objects that the developer can extend with his/her own functionality:
BACKBONE JS PATTERNS CODE
Backbone.js is a lightweight JavaScript library that enforces developers to organize their code in a clean and efficient manner and eases the development of SPAs. What is Backbone.js?īackbone.js is a Model-View-Whatever (MVW) library that was written by Jeremy Ashkenas, the creator of CoffeeScript and Underscore.js.

While we won’t cover the ways Backbone.js can help you create SPAs, you can find more content about it in “Pro Single Page Application Development” (Apress) book or by searching online. In this article we will take a look at Backbone.js and how you can use some of its features. One of the popular libraries that help to create SPAs is Backbone.js. The popular SPA frameworks are AngularJS and Ember. One recommended way to create SPAs is by using libraries or frameworks that expose features such as routing, template engines and ways to communicate with the server. That means you can create RIAs using HTML, CSS and JavaScript and gain a lot of smart client qualities, such as being stateful and responsive. This shell is changed via JavaScript interactions made by the users, client-side template engines and client-side routing mechanisms. SPAs are web applications that include only one HTML page that acts as a shell to the whole application.

In the past few years, we have also seen an emerging trend to build Single Page Applications (SPAs). These changes help web developers to build next generation rich internet applications (RIAs). Graphics, multimedia and device interactions are first class citizens in web applications and you don’t have to use plugins to create sophisticated features. Standards such as HTML5, ECMAScript and CSS3 are helping to design more responsive and interactive web applications.
