Preface

We JavaScript developers live in exciting times. Every month we're presented with an incredible new browser feature, open source library, or software methodology that promises to vastly improve on whatever came before it. And then, just as soon as one new technology arrives, another almost inevitably follows it, promising still further innovation.

Amid this ever-changing landscape of new technologies only a very few libraries manage to stay not just relevant but essential over a long period of time, despite having newer challengers. For many web programmers jQuery was the first such library, but in recent years another library has proven itself to be similarly indispensable. That library is Backbone.

Backbone offers developers a wide range of foundational pieces from which they can build any manner of web application. From its simple yet flexible class system, to its event-based and AJAX-simplifying data containers, to its DOM manipulation and single-page user-facing components, Backbone provides everything needed to form the underlying framework of a site.

However, at first Backbone's incredible power and flexibility can be intimidating. When faced with over a hundred different methods spread across four base classes it can be challenging for a new Backbone developer to determine which ones to use and when. In addition, while Backbone is very "opinionated" about its core functions, it takes a deliberately agnostic approach to just about everything else. This allows developers to choose the perfect approach for their application, but at the same time all those choices can be daunting to someone unfamiliar with Backbone.

In this book we offer two things, both drawn from years of experience using Backbone to create and maintain a real-world web-based application. First, we will provide you with an understanding of all of Backbone's essentials. By the time you complete this book, you will have learned everything you need to create powerful and maintainable web applications using Backbone.

But at the same time, in addition to just explaining Backbone itself, we'll also explain the wider, "meta" level of Backbone programming. From advice on how to implement important details of your classes, to examinations of how Backbone can be made even more powerful when connected to the larger JavaScript ecosystem, we have endeavored to not only show how to use Backbone, but how to use it well.

Welcome to Backbone Essentials.

What this book covers

Chapter 1, Building a Single-Page Site Using Backbone, introduces Backbone and explains why it is such a popular choice of framework

Chapter 2, Object-Oriented JavaScript with Backbone Classes, details Backbone's class system, a significant improvement over JavaScript's native system

Chapter 3, Accessing Server Data with Models, begins our exploration of Backbone's data management, event listening, and AJAX capabilities with Backbone's Model class

Chapter 4, Organizing Models with Collections, continues our exploration of Backbone's data management capabilities, only this time using multiple data sets with the Collection class

Chapter 5, Adding and Modifying Elements with Views, examines Backbone's DOM rendering and event-handling View class

Chapter 6, Creating Client-side Pages with Routers, introduces the heart of Backbone's single-page architecture, the Router class

Chapter 7, Fitting Square Pegs in Round Holes – Advanced Backbone Techniques, explores advanced Backbone patterns for solving tricky problems

Chapter 8, Scaling Up – Ensuring Performance in Complex Applications, looks at the causes of performance issues in Backbone applications, and how to prevent them

Chapter 9, What Was I Thinking? Documenting Backbone Code, considers different strategies for documenting your application, including JSDoc and Docco

Chapter 10, Keeping the Bugs Out – How to Test a Backbone Application, recommends best practices for testing a Backbone application, with examples from the Mocha and Sinon libraries

Chapter 11, (Not) Re-Inventing the Wheel – Utilizing Third-Party Libraries, previews a variety of 3rd party libraries, some Backbone-specific and some not, which can benefit a Backbone application

Chapter 12, Summary and Further Reading, looks back on the topics previously discussed and considers their application in the real world

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

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