Category Archives: Model-View-Controller

Stop Using Backbone As If It Were A Stateless Web Server

In the web development world with MVC based back-end servers, nearly everything is kicked off with routes. Look at rails for example. If you want a list of items, you hit /items and the router executes the index method on … Continue reading 

Also posted in AntiPatterns, Backbone, Javascript, JQuery, Pragmatism, Principles and Patterns | 30 Comments

Knockout Style Data-Bind Attributes For Backbone

Hot on the heels of my Backbone.ModelBinding plugin release, I pushed a significant update out to the github repository. Included in this release is the rest of the form input types, including radio button groups, select boxes, etc (be sure … Continue reading 

Also posted in Backbone, Backbone.ModelBinding, Javascript | 7 Comments

Awesome Model Binding For Backbone.js

A few weeks ago, Brandon Satrom introduced me to Knockout.js by pointing me to a video by Steve Sanderson. I haven’t had a chance to try KO, yet, but I have to say I was blown away by the data-binding … Continue reading 

Also posted in Backbone, Backbone.ModelBinding, Javascript, JQuery | 16 Comments

References, Routing, And The Event Aggregator: Coordinating Views In Backbone.js

I recently found myself needing to facilitate communication between two backbone views. The first view is a medication – one that is currently being taken by a particular patient. The second view is the add/edit view that allows the patient … Continue reading 

Also posted in Backbone, Design Patterns, Javascript, Principles and Patterns | 73 Comments

Rendering jQuery Templates With Backbone Views

In my previous examples of using views with Backbone.js, I showed a simple login form that was built directly in to the page’s html markup. In a more complex app, you are likely going to load content from a server … Continue reading 

Also posted in Backbone, Javascript, JQuery, JSON | 18 Comments

Solving Backbone’s “this.model.view” Problem With Underscore.js

In my last post, I briefly touched on a small problem in the relationship between the view and the model. Here’s the relevant code, again:   This is some awful code, honestly. I didn’t like it when I first wrote … Continue reading 

Also posted in Backbone, Javascript, JQuery | 11 Comments

Binding A Backbone View To A Model, To Enable and Disable A Button

Continuing the contrived example from yesterday – a very simple login form – I wanted to show how Joey and I are using backbone’s events and models to enable and disable a button on the form.   The Form Layout … Continue reading 

Also posted in Backbone, Javascript, Principles and Patterns | 15 Comments

Intro To Backbone.js: How A Winforms Developer is At Home In Javascript

Today, I was introduced to Backbone.js and I almost immediately fell in love with it. It’s powerful. It’s elegant. But most of all, it’s a set of design and interaction patterns that I have a lot of experience using.   … Continue reading 

Also posted in Backbone, Design Patterns, Javascript, JQuery, Model-View-Presenter | 25 Comments

Sometimes It’s Better To Use A Ruby Hash Than Create A Custom Class

The Eloquent Ruby book talks about the use of hashes and arrays vs classes. One of the things it covers is how hashes and arrays are often used by experienced ruby developers in place of custom classes. Coming from a … Continue reading 

Also posted in AntiPatterns, Pragmatism, Principles and Patterns, Ruby | 6 Comments

Don’t Do Role-Based Authorization Checks; Do Activity-Based Checks

I’ve built a few dozen security mechanisms in my career. Unfortunately, I kept getting it wrong, hence the need to keep building them. Over the years, though, I learned a number of different ways that a security system can be … Continue reading 

Also posted in .NET, Analysis and Design, AntiPatterns, C#, Rails, Ruby, Security | 51 Comments