Chapter 1. Building a Single-Page Site Using Backbone

In this chapter, you'll learn both what Backbone is and why you will want to use it to create web applications. In particular, we'll examine the following topics:

  • Backbone's history and how it fits into the larger history of web development
  • The advantages of Backbone's single-page architecture
  • How real-world companies are using Backbone to power their sites

What is Backbone?

Created in 2010 by Jeremy Ashkenas, Backbone is a part of an entirely new breed of JavaScript libraries. Depending on who you ask, this type of library can be referred to as a rich application framework, a single page library, a thick client library, or just a JavaScript framework. Whatever you choose to call them, Backbone and its related libraries, such as Angular, Ember, and CanJS, provide tools that can be used to build websites that are so powerful that they go beyond being mere sites and become full-fledged web applications.

Backbone is made up of the following five major tools:

  • A class system, which makes it easy to practice object-oriented programming
  • A Model class, which allows you to store and manipulate any kind of data as well as exchange this data with and from your remote server using AJAX
  • A Collection class, which allows you to perform the same data manipulation and transmission but on groups of Models instead
  • A View class, which can be used both to render the DOM elements that make up the page and to manage any user interactions that occur on them
  • A Router class, which enables you to create an entire site, with any number of virtual pages, using only a single HTML file

While conceptually very simple, together these components allow you to create websites with a level of sophistication and robustness previously unseen on the World Wide Web (WWW).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.94.202.151