Category Archives: Software Development

OpenID 2.0’s Killer Feature

The OpenID 2.0 spec has been finalized. On the surface, it does not seem to be very different from the 1.1 spec but it does include at least one sweet new feature. It provides protocol support for directed identity. Directed identity is the concept of having a single identity that appears to be a different identity for every relying […]

How REST Can Relieve Your (Lack of) Documentation Guilt

A couple of months ago we hired a contractor to write a reporting interface for our high volume monitoring system. Our system exposes all of it’s data in RESTful web services, and his job has been to take that data and allow users to create reports based on it. This morning a couple of my teammates and I […]

When To Use Exceptions

Marty Alchin recently posted about the “evils” of returning None (or nil or null depending on your language of choice). I think he has it basically right. Sure there are situations where returning nil1 is appropriate, but they are pretty rare. For example, if a method actually does what the client asked and there is […]

ActiveRecord race conditions

Ara Howard has discovered that the ActiveRecord validation mechanism does not ensure data integrity.1 Validations feel a bit like database constraints but it turns out they are really only useful for producing human friendly error messages. This is because the assertions they define are tested by reading from the database before the changes are written to the database. As you […]

HTTP Authentication with shared identities

Authentication has been bane of my existence lately. By which I mean, it is complicated and interesting and I am loving every minute of it (but, as you can see, I am not going to let that stop me from complaining about it). However tonight I have run into an authentication problem that I am not […]

Please talk faster

I find myself ingesting more and more information in the form of audio and video. This is rather unfortunate since neither well suited for this purpose. The primary purpose of audio recordings are to fill the long silences that otherwise occur while moving from one point to another in a vehicle. The primary purpose of video […]

Things to be Suspicious Of — attr_accessor_with_default with a collection

My team ran into this problem yesterday where the a particular, very important, request was failing in one of our Rails apps. The failure did did not make much sense and even more confusingly, the same code worked perfectly in the console. As part of debugging the problem we restarted the mongrel cluster, and suddenly everything worked […]

Decouple the File in your Rails Plugin, Please

Defining new behavior for core Rails classes in mixins is a common pattern in Rails plugins. This allows for a separation of concerns that improves maintainability and digestability. However, it raises a bit of question about where the mixin inclusion step should take place. Should it happen in the plugin’s init.rb or in the same file as […]

JSON Schema Definition Languages

We recently settled on using JSON as the preferred format for the REST-based distributed application on which I am working. We don’t need the expressiveness of XML and JSON is a lot cheaper to generate and parse, particularly in Ruby. Now we are busy defining dialects to encode the data we have, which is happy work. […]

Mocking

Mr Whitney recently posted an article in which he described mock objects as “bug aggregators”. I once held a similar point of view. Back then my belief was that test doubles (mock, stub, etc) should only be used when real objects would not work, either because they were too hard to setup or because they were too slow. Recently, […]