It’s no secret that Ruby trivializes many classic design patterns. What might take 30 lines in Java can often be a one-liner in Ruby. But there’s more to learning a design pattern than reading some pseudo code about Widgets and AbstractFlyweightDecoratorFactory classes. The Command pattern is an abstraction that will be familiar to most experienced …
First released to the public in 2004, Ruby on Rails is an open source web-application framework written in the Ruby programming language. We sat down with Carbon Five Director of Engineering Matt Brictson to discuss all things Ruby on Rails, including the benefits of using Rails versus an all-Javascript stack, what’s in store for the …
I love playing around with the LeapMotion. It is a wonderful little piece of technology, has great documentation, and is way ahead of its time. More specifically, I’m interested in its potential to communicate with MIDI, the protocol which allows software to translate musical data. A quick aside: My background is in music, having played …
It was about a year ago that we first announced Raygun, our Rails applications generator. Since then, many apps have been zapped into existence, both internally at Carbon Five and in the wild. Raygun evolved over the year; it does more of some things and less of others. Let’s see what Raygun does and what …
All the programmers around me seem to have very strong opinions about functional programming. The Internet certainly loves to talk about it. Some of the concepts are interesting – but many of them (at first) don’t seem to apply for those of us writing database-fronting web applications. What can we apply from a world in …
Acceptance tests are a great tool for guiding [outside in testing] and defining application behavior. Unfortunately they are also notoriously slow and often brittle. At Carbon Five we usually use Capybara to drive our acceptance tests (either directly in RSpec feature specs or within Cucumber steps) so let’s explore some ways we might accidentally write …
In Sinatra Best Practices: Part One we saw how to break up your Sinatra application into smaller bite-size pieces. Today, we’re going to explore testing, which will also compel us to address environment configuration.
While Sinatra’s one-file approach may work well for your one-off, smaller application – it can quickly become a mess as you add on multiple routes, route-handlers, helpers, and configuration. So what’s a programmer to do? In reading Sinatra’s documentation I’ve found a few morsels that have enabled us to split our otherwise-monolithic (I realize this …
When integrating 3rd-party APIs, it’s important to listen to your tests. The most common design relies on tests that directly mock the 3rd-party API. These tests are brittle, but are often acceptable because, well, they work. A better approach is to take the time to design an app-specific interface to wrap the 3rd-party API. The …
As an application matures, classes begin to take on more and more responsibilities. Eventually a class’s main responsibility starts to become obscured. You can prevent overwhelming your classes by introducing collaborators to help them fulfill their responsibilities. In this post, we’ll look at an example of using a collaborator to prevent non-domain responsibilities from creeping …