JavaScript Web Applications by Alex MacCaw

JavaScript Web Applications is not a book for beginners. In fact, you need to have been doing a fair share of JavaScript development to benefit from it. But if you do, It’s indispensable! Because this is finally a book that’s showing how to structure your application in a way that keeps you sane as the application grows.

The patterns that are shown in the book are all Model-View-Controller (MVC), the popular design pattern being used in a lot of back-end frameworks such as Ruby on Rails, ASP.NET MVC and CodeIgniter (PHP) to name a few.

The first part of the book introduces the different aspects of the MVC pattern. Then there’s a few chapters dealing with JavaScript templating, dependency management, some of the new HTML5 API’s and JavaScript deployment. In the last part of the book 3 different libraries for applying the MVC pattern to a project are introduced.

Desktop-like applications

Traditional web applications require a lot of requests to the server, but using MVC on the Frontend you can create One-Page-Applications with all the logic in the frontend. This might sound crazy at first, but after reading the book and trying it out for myself, I’m confident that this is a good approach for certain kinds of web applications. It’s actually more like programming Desktop Applications.

This approach gives you applications that responds immediately on user interaction. Because it doesn’t have to perform constant server requests, it is snappy and responsive.

Not for all projects

I want to be dead clear here. Im definitely not saying that this is the right approach for all web applications, because it’s not. For starters, using a JavaScript only approach means that not everybody can use it, for example people using screen readers or have JavaScript disabled. So for content intensive sites this is not the way to go. But for more advanced Web Applications and for mobile web apps aimed at smart phones, it’s certainly a viable option.

JavaScript libraries

As I mentioned before Alex presents a few libraries that will make it easier to create a MVC architecture in the last part of the book. He has actually created one of the libraries himself, Spine.js. The other libraries are Backbone.js and JavaScriptMVC.

Although I’m sure that all theses libraries are good I myself was most compelled by Backbone.js which I’m currently using to build a mobile web app. I think it’s great in the way it makes the code so much more structured and easier to maintain. It essentially brings backend programming structure to the world of JavaScript.

Conclusion

If you have a few JavaScript projects under your belt and you feel that there must be better ways to organize and structure the code, this book is definitely for you. It will teach you how the MVC pattern works on the frontEnd and gives you the tools and knowledge to leverage your own applications.

Bookinformation

Title:
JavaScript Web Applications
By:
Alex MacCaw
Publisher:
O’Reilly Media (August 30, 2011)
Pages:
280
ISBN:
144930351X
ISBN-13
978-1449303518

Buy JavaScript Web Applications from Amazon.com

Note: I wrote this review for O’Reilly’s Blogger Review Program. Their deal is pretty good: You get a free e-book to read and once you post a review you get another. Try it yourself if you’re interested in reviewing books.

About the author

Gabriel Svennerberg is an UX Designer and FrontEnd Developer living in Sweden. When he's not busy designing or building applications at Meetod, he writes about UX Design and all things web on In usability we trust. Gabriel is the author of the book Beginning Google Maps API 3 published by Apress. Gabriel on Google+