- Revolving Door: MPAA Hires Chief USTR Negotiator Behind ACTA And TPP’s IP Chapter
- Copyright Maximalists’ Incredible Sense Of Entitlement: If It Challenges The Biz Model We Chose, It Must Be Illegal
- Turkey’s Prime Minister Sues His Own Country Over Twitter
- Picturefill 2
- Police File On Student ‘Bullied Into Committing Suicide’ Strangely Lacking In Evidence Of Bullying
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- December 2008
- November 2008
- October 2008
Category Archives: Web Development
Web Hosting Related Articles You May Need
The sub-title of Swarnendu De‘s Backbone.js Patterns and Best Practices (Packt Publishing, 2014) is “A one-stop guide to best practices and design patterns when building applications using Backbone.js.” The Backbone.js site describes Backbone.js as follows:
Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
The Preface further reinforces the point that this book is not for beginners when talking about the book’s objective: “Whether you are an intermediate- or advanced-level Backbone.js developer, this book will guide you through the best practices and patterns to handle different issues with each Backbone component.”
Chapter 1: Reducing Boilerplate with Plugin Development
The initial chapter of Backbone.js Patterns and Best Practices introduces the basics of Backbone.js and provides short descriptions of Backbone.Model, Backbone.View, Backbone.Collection, Backbone.Router, and Backbone.Events. The first chapter introduces the Underscore.js utility and mentions that “Backbone.js has a hard dependency on Underscore.js.” The author also mentions Lo-Dash as an Underscore.js alternative. The core coverage of this initial chapter is on reusing code by extending (with and without a base class) and using mixins.
Chapter 2: Working with Views
Chapter 3: Working with Models
Backbone.js Patterns and Best Practices‘s third chapter discusses working with Backbone models. The chapter begins by outlining the basics of Backbone models and how to use Backbone models with an emphasis on CRUD (create/read/update/delete) operations. Model validation is covered next with examples of using direct Backbone model validation as well as using Backbone.Validation. Chapter 2 covers serialization of Backbone models and using Backbone-relational.js for relational data work with Backbone.
Chapter 4: Working with Collections
Chapter 4 of Backbone.js Patterns and Best Practices defines a Backbone collection as “an ordered set of models” that includes “functionality to add, remove, sort, and filter models, and save to or fetch data from the server.” The chapter includes a brief overview of Backbone collections before moving onto describing how to perform database-related operations on a Backbone collection. Sorting and filtering of Backbone collections are also covered in the fourth chapter.
Chapter 5: Routing Best Practices and Subrouting
The fifth chapter in Backbone.js Patterns and Best Practices describes a Backbone router as a mechanism that matches a “URL fragment” to an invoked method. The chapter provides an overview of Backbone routers and routing before moving onto coverage of “best practices for working with routers.” In the course of this discussion, the author references Marionette.AppRouter and Marionette.Controller. Sub-routing is described in Chapter 5 and the extension backbone.subroute is specifically referenced.
Chapter 6: Working with Events, Sync, and Storage
Chapter 6 of Backbone.js Patterns and Best Practies covers “custom events, Backbone.sync() method and Backbone.LocalStorage.” The portion of the chapter on events begins with a definition of events from the Backbone.Events API page. This section demonstrates how easy it is to create custom events in Backbone, contrasts use of Events to use of Callbacks, and provides a case study describing use of events. The section of Chapter 6 on Backbone.LocalStorage discusses and demonstrates use of Backbone.localStorage Adapter before mention an alternative called Backbone.dualStorage.
Chapter 7: Organizing Backbone Applications – Structure, Optimize, and Deploy
As its title suggests, Chapter 7 of Backbone.js Patterns and Best Practices discusses issues related to application structure, optimization, and deployment of Backbone-based applications. The author proposes an application directory structure which “is not something that will work universally for every application,” but “lots of developers use it for their projects without any issues.”
Chapter 8: Unit Test, Stub, Spy, and Mock Your App
Appendix A: Books, Tutorials, and References
Appendix A includes the author’s recommendations for three books on Backbone.js along with recommended online tutorials and blog posts on Backbone.js. This appendix also includes references to additional resources on testing Backbone-based applications with QUnit and SinonJS as well as references to more Backbone plugins and tutorials.
Appendix B: Precompiling Templates on the Server Side
Appendix C: Organizing Templates with AMD and Require.js
Although two chapters earlier in Backbone.js Patterns and Best Practices discuss AMD and Require.js briefly, both chapters reference Appendix C for additional details. The example in this appendix is built on top of requirejs-tpl.
- My most important observation is that the implication of Backbone.js Patterns and Best Practices‘s title and the explicit statements in its Preface that the book is targeted at intermediate Backbone developers should not be taken lightly. Although the book does provide some brief introductory material on most of the subjects it covers, at least some familiarity with the basics of a Backbone.js-based application would be extremely beneficial in realizing the full value of reading this book.
- There are not many images or screen snapshots in this book, but these are not particularly important to the content.
- Even in the PDF version of Backbone.js Patterns and Best Practices that I reviewed, the code listings are black text on white background with no color syntax. Most of the code listings are short enough to mitigate the issue, but color-coded syntax would be easier to read.
- Backbone.js Patterns and Best Practices is written with the intent to discuss issues that the author believes developers frequently run into when developing Backbone-based applications.
Conclusion and Recommendation
Original posting available at http://marxsoftware.blogspot.com/ (Inspired by Actual Events)
Packt Publishing recently published HTML5 Data and Services Cookbook by Gorgi Kosev and Mite Mitreski. The subtitle of the book is: “Over one hundred website building recipes utilizing all the modern HTML5 features and techniques!” I accepted an invita… Continue reading
Happy New Year 2011!The HTTP 404 Status Code is one of the HTTP status codes that all web developers and nearly all web users are all too familiar with. It is an HTTP response indicating that an HTTP request was received by the intended server, but tha… Continue reading
I know you’re busy, so I’ll make this message ultra quick.
If you’ve ever wished you could make more money from less effort, you need to drop what you’re doing and read this message IMMEDIATELY.
You’re about to see how you can make a comfortable, *hands off* income, from simple websites that take less than hours […] Continue reading
No matter how long you’ve played your six string for, at some point, every guitar player has a choice to make. Either you can decide to play just for fun, or, you can decide to get really serious and decide to master and learn guitar. If this is you, congratulations, you are about to […] Continue reading
There’s something very appealing about learning how to play guitar. If you’ve ever desired to play, you’re not the only one. Millions of others have considered learning before you and there’s sure to be millions more who will want to in the future. Maybe, it’s because the guitar is a crucial part of every song. […] Continue reading
Did you always dream of being a rock or country musician, playing in a band for recreational activity, in church, or simply for your own accomplishment? We all had posters of our favorite bands on our wall when we were young.
How many songs did you play the air guitar to and dreamed of playing guitar […] Continue reading
Learning guitar is not that difficult – in my opinion, what you need the most is desire and interest in music. The rest usually takes care of itself. However, there are ways to speed up your learning curve 10’s of times. I’ll share with you what I think is the best method to learn guitar […] Continue reading