Book Review / Overview: “JavaScript Web Applications” by Alex MacCaw

Review:

 5of5stars

Wow. This book covers so much content that it could easily have been split into 2, 3, or maybe even 4 books. It is a book on building applications, not web sites (though many of the techniques would also work for web sites). And as such, there is a lot of emphasis on the engineering that goes into building such applications, from the design patterns we use, to testing, debugging, and deployment. With the power and features that newer browsers and JavaScript libraries are providing, we’re able to build richer and more full-featured web apps every day. In a lot of cases this means more JavaScript code, and the more code we have, the more important it is that we follow software engineering best practices.

I was on the fence about whether to give this book 4.5 or 5 stars. There is too heavy an emphasis on jQuery for my liking, but on the other hand, there is so much detail that I am sure that I will go back and try many of the examples and libraries referenced in the book. And, I have yet to see another book cover JavaScript applications in this way. So, just as a reference to how we can and should be building JS applications, I had to give the full 5 stars. If you’re building rich internet applications, or are planning to, I think this is a very useful read.

Overview:

  1. MVC & Classes – An overview of writing object-oriented JavaScript and of the Model-View-Controller (MVC) design pattern
  2. Events & Observing – Coverage of the DOM event model and descriptions of how JS libraries provide cross-browser support and add features for custom events
  3. Models & Data – Covers how to create data models that are completely client-side. It includes using HTML5 localStorage to persist values locally and how to use Ajax to communicate model changes back to the server.
  4. Controllers & State – Packs a lot of application patterns and information into 1 chapter, including client-side MVC, a JavaScript module pattern, libraries, state machines, routing, Ajax crawling and the Google Ajax Crawling Specification, and using the HTML5 History API.
  5. Views & Templating – This chapter focuses on the ‘View’ of ‘Model View Controller’. I found the in depth description of templating and data binding particularly interesting. I use a library that has these features, but it was good  to see how you would code this from scratch using jquery libraries that are available.
  6. Dependency Management – This chapter focuses on script dependencies. It introduces CommonJS, script loaders, and server side tools to combine and minify JS. It’s a very good reference chapter.
  7. Working with Files – Introduces the HTML5 File APIs, covering file inputs, drag/dropping of files, reading files, Ajax progress events and more. – (Note to self: MUST TRY SAMPLE CODE)
  8. The Real-Time Web – Covers WebSockets and the PubSub pattern with useful references to libraries such as node.js, Socket.IO, Juggernaut, and Pusher.
  9. Testing and Debugging – Introduces some JavaScript testing frameworks including QUnit and Jasmine, some drivers for continuous integration testing including Watir and Selenium, and libraries to help with headless browser testing including Envjs and Zombie.  It also briefly goes into Firebug and Web Inspector for debugging. This could easily be broken into 2 chapters or even a whole book.
  10. Deploying – A very nice introduction to things you should do, but don’t need to do, when deploying a JavaScript application. It includes information on caching, minifying, gzipping, and doing performance testing.
  11. The Spine Library – A lightweight Js library, written by the author, that includes MVC, events, and classes. It works with jquery or other libraries. Looks interesting.
  12. The Backbone Library – A lightweight MVC library with models, controllers, and views that depends only on underscore.js. It will work with jquery.
  13. The JavascriptMVC Library – An open-source jQuery-based framework that includes support for testing, dependency management, error reporting, package management, code cleaning, custom events, jQuery extensions, and documentation.

Chapters 15 – 17 are appendices: jQuery Primer, CSS Extensions, CSS3 Reference

Advertisements
This entry was posted in Book Reviews, JavaScript, Web Development. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s