Category Archives: Backbone

Modeling Explicit Workflow With Code, In JavaScript And Backbone Apps

This post has been revised and reposed on blog.   A long time ago, in what seems to be a previous life at this point, I wrote a small blog post about modeling and creating an explicit return value … Continue reading 

Also posted in AntiPatterns, Javascript, Principles and Patterns, Workflow | 14 Comments

Wrapping $.ajax In A Thin “Command” Framework For Backbone Apps

A large number of my recent client applications, built on Backbone, have been using straight jQuery AJAX calls. Sometimes its in combination with Backbone’s persistence method, but other times I end up using AJAX calls in place of Backbone calls. … Continue reading 

Also posted in AJAX, JQuery, Semantics, Underscore | 7 Comments

View Helpers For Underscore Templates

Underscore’s template engine lets you run any arbitrary JavaScript code that you want, within a template. You could write an entire JavaScript application within an underscore template if you want. But this is a really bad idea. Templates should be … Continue reading 

Also posted in Javascript, Marionette, Underscore | 20 Comments

Decoupling Backbone Apps From WebSockets

I’ve been doing a lot of work with web sockets lately, in my Backbone applications. And I’ve fallen in to a pattern that I really like, where my Backbone application doesn’t actually know anything about web sockets. All it knows … Continue reading 

Also posted in Javascript, Marionette, Pusher, SignalR, Socket.IO, Web Sockets | 12 Comments

Managing A Modal Dialog With Backbone And Marionette

My current client project is using Twitter Bootstrap, and I have to say I’m loving it. It provides a simple way to get started with common layout and design elements, and includes a handful of UI widgets and features that … Continue reading 

Also posted in DOM, Javascript, JQuery, Marionette, Twitter Bootstrap | 36 Comments

ClassyObjects: A JavaScript Class-y Inheritance Example

I recently released a screencast that covers JavaScript Objects & Prototypes on my WatchMeCode site. In this screencast, I go through all of the basics of working with objects in JavaScript, including prototypal inheritance. Toward the end of the video, … Continue reading 

Also posted in Classy Inheritance, Ember, Javascript, Prototypal Inheritance | 3 Comments

JavaScript Performance: Pre-Compiling And Caching HTML Templates

If you’re using HTML templates with a JavaScript application, you need to be caching the template’s raw text and/or pre-compiled version of the template. All of this spawned from a fun thread of discussion on a StackOverflow question. DOM Selection … Continue reading 

Also posted in DOM, Javascript, JQuery, Marionette, Performance | 7 Comments

Composite Views: Tree Structures, Tables, And More

One of the more recent features that I added to my Backbone.Marionette framework is the CompositeView. It’s actually been in the code for a while now, but in a recent version I extracted it out of the CollectionView and in … Continue reading 

Also posted in Composite Apps, Design Patterns, Javascript, JQuery, JSFiddle, Marionette | 33 Comments

Revisiting The Backbone Event Aggregator: Lessons Learned

It’s been a while since I originally talked about using an event aggregator in my Backbone applications. Since then, I’ve encapsulated the “vent” object in my Backbone.Marionette application and I’ve also realized that a lot of what I wrote originally … Continue reading 

Also posted in Composite Apps, Javascript, Marionette, Messaging | 22 Comments

Providing Synchronous / Asynchronous Flexibility With jQuery.when

I’ve quickly become a fan of jQuery’s Deferred / Promise features. They’ve been around for a little bit now, but I only recent started using them and they’ve helped me solve a number of problems with my asynchronous JavaScript code. … Continue reading 

Also posted in Async, Javascript, JQuery, Marionette | 8 Comments