Developing Backbone.js Applications |
Author: Addy Osmani Backbone.js is one of the many JavaScript libraries that you could adopt. What has it going for it and is a book a good way to find out? It is probably a sign of immaturity that that there are so many JavaScript frameworks, but you still have to pick one unless you are going to reinvent the wheel. Backbone.js is a JavaScript library designed to make building single-page web apps easier. It was started by Jeremy Ashkenas, who also created the CoffeeScript language, but Backbone.js is pure JavaScript. It is roughly speaking an MVC approach to building apps. It also uses a Restful JSON based API and the actor model - and this is the sort of description that might put a lot of practical JavaScript programmers off. This book is an introduction to Backbone.js, but it isn't a beginners book. You need to be fluent in JavaScript and related technologies to get anything much from it. However, it does start off with a chapter on what MVC and Backbone.js are all about. Then it expands, in Chapter 2, on MVC as a design pattern. If you don't know the theoretical mess that MVC gets itself into when applied to web apps, this is a good introduction. Chapter 3 is where we first start using Backbone.js to build a simple example. The big problem is that there really is no preparation for this and no "bigger picture". You are presented with code and the main explanation of the code is in the comments. There is no real discussion of how the code is created or how to think about working with Backbone.js. Instead you are expected to get the information you need by reading the code. If you like this sort of approach then you will find this a good boo. If you prefer something that gives you an overview and explains the principles then you will be less happy. Chapter 4 is a more in-depth look at the example and you build a simple ToDo application. Then Chapter 5 presents a larger book library application, complete with a Restul api. On the way you also get to build the backend using Node.js and MongoDB. The next chapter looks at Backbone.js extensions - MarionetteJS and Thorax and Chapter 7 runs through a set of common problems and their solutions.
Chapter 8 introduces the idea of modules using RequireJS and Asynchronous Module Definition. Next we have another chapter on creating an example app but now using modules. Chapter 10 explains how to create a multipage app. Chapter 11 introduces the idea of boilerplate modules with Grunt. Chapter 12 explains how to use Backbone.js with jQuery Mobile to create mobile apps. The next three chapters are on tests and test driven app creation using three different test frameworks. First we have Jasmine, then QUnit and finally SinonJS. While test driven development is important, not everyone is committed to it and three chapters on three frameworks might seem like overkill. After a short round out, that's the end of the book. However, it is worth taking a look at Appendix A where a simple MVC framework is developed. This has a lot to teach and once you have read it many of the features of Backbone.js become easier to understand. I would recommend reading it after Chapter 2 and before getting too deep in. This is a book about creating single page applications that just happens to use Backbone.js, rather then being in depth coverage of the framework. If you work at it you can get some value from the book, but it doesn't hand it to you on a plate. You need to be a good JavaScript programmer and be quite sophisticated in your outlook to like this book.
|
|||
Last Updated ( Sunday, 15 February 2015 ) |