Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Practical Backbone Patterns

Practical Backbone Patterns

In this presentation, I cover a few of the things that I find myself doing over and over again in any Backbone code that I work with.

There are a couple of points I want to stress:

- Sometimes you may not even need a Javascript framework. Maybe just use Javascript and see how far you get without it!

- Lots of small classes that are easily testable make for fun programming

- Avoid single page apps unless you have a good reason too. Can you really justify it? Do your customers care? Zendesk is a good example of a single page app. Its the kind of thing you have open all day. Great use.

- Think about passing a template as an option to the class your building. What if you were responsible for the UI - not it. (check out the autocompletor link below)

- If you need to attach existing behaviour to a page with a Backbone View - checkout the ProxyView (check the link below)

Here are the links to the code I open sourced along with this presentation:

https://github.com/envato/backbone.proxy-view
https://github.com/envato/backbone.autocomplete-view

The presentation git repo is here:

https://github.com/keithpitt/practical-backbone-patterns

Keith Pitt

March 13, 2013
Tweet

More Decks by Keith Pitt

Other Decks in Programming

Transcript

  1. that I think you may also find useful but I’m

    probably wrong so yeah. I also don’t like the word pattern but couldn’t think of anything else. Also don’t throw things at me because I’m new and nervous. @keithpitt Shit that seems to work for me when I do