Over the past year I have been reading a lot about design patterns. One of the patterns I learned about was the Template Method pattern. After reading about it, I realized that I had already been using it and found there was a name for it. I wanted to show a practical example of this pattern where I used it to create a reusable class for autocomplete components.
One of the things I have found most challenging when working with Backbone.js is writing maintainable and unit testable views. Based on recent experience, I have been writing lots of unit tests for models, collections, reusable view abstractions, and services, but not for my application’s views.