Better System Tests – Increasing Testability without Sacrificing Elegance

Writing tests for your software is a great idea! I’m glad we’re all doing it. And I’m glad we’ve all put a lot of thought into categorizing the tests–by unit, integration, system, etc. Of all the tests you can write, my professional experience has shown repeatedly that system tests are the most valuable. Nothing gives you as much proof as validating the entire system working in concert. Read more on Better System Tests – Increasing Testability without Sacrificing Elegance…

Computed Properties with Computed Dependent Keys in Ember.js

Ember’s support for computed properties and bindings is excellent: powerful and not too complicated. Every so often, however, I find myself wanting a particular feature that is not built into Ember’s object system. I want the ability to declare a computed property whose dependent key(s) are actually the value of another computed property. Read more on Computed Properties with Computed Dependent Keys in Ember.js…

My Craftsman Exchange in Sweden

At Atomic Object, we have a history of establishing craftsman exchanges with a Swedish company, Citerus. This relationship dates back to before either AO or Citerus were founded: when Carl was a professor at Uppsala in Sweden.

The purpose is fairly straightforward: one employee is sent over the Atlantic to the other company and spends a week immersed in the other’s culture and business. Through sharing our knowledge, experience, and perspectives, we both benefit. Read more on My Craftsman Exchange in Sweden…

Taking Control of Logging in Clojure

Clojure inherits some interesting tradeoffs as a result of being built atop the Java Virtual Machine. One upside is the availability of many full-featured and mature Java libraries. But one downside is the need to survey the historical as well as technical landscape of your available choices.

Unsurprisingly, when it came time to add proper logging to my project, I had to make sense of the several available Java logging libraries. Here’s what I found. Read more on Taking Control of Logging in Clojure…

Multiplatform C (with Networking)

I’ve been working on a project with a diverse set of software components that must all work together and communicate over the network. There are separate Mac and Windows clients that must communicate with the same unix server. And while there’s already a well-defined protocol for their network communication and message passing, we also need to transmit a large stream of somewhat time-sensitive data. Read more on Multiplatform C (with Networking)…

Understanding Macros and Code as Data

The other day, while having a conversation in the office about Clojure macros, I was reminded that not everyone fully understands the phrase “code as data” or its useful repercussions. This isn’t surprising, as there are still very few mainstream languages that feature this, and most of the ones that do are lisp dialects. I think that’s unfortunate, as it’s a conceptually simple tool that you can get a lot of leverage out of. Read more on Understanding Macros and Code as Data…

Flexure: A Lightweight Model Framework for Ember.js

Ember Data is ambitious and does a lot of heavy lifting for you, which requires that it makes some big assumptions. It assumes you need an identity map, object relationship management, dirty state tracking, and that your interaction with your server is primarily or entirely CRUD operations.

I recently worked on a project where these assumptions didn’t fit, and I was in a tough spot. While Ember Data has a handful of alternatives, they all share these assumptions. I had to choose: I could use Ember Data and fight it along the way, or I could roll without it at the cost of spending time implementing or copying functionality that Ember Data provides for free. Read more on Flexure: A Lightweight Model Framework for Ember.js…

Learning to Love Ember’s Dependency Injection

Ember is an opinionated framework. Like other such frameworks, it takes a while to learn how the pieces are designed to fit together and how you can structure your code to be harmonious with it, rather than fight it.

What I’ve found is that often, it helps to think outside the boxes ember provides you: controllers, routes, components, etc. Ember’s dependency injection is a great tool for helping you with this.

The Basics

Objects are named in Ember’s dependency injection container are given a full name that consists of two parts: the type of object, and a name. For example, route:application would be the name for your ApplicationRoute. Or controller:question.edit for your QuestionEditController. You’re not limited to Ember’s predefined categories, however; you are free to make up your own type. Read more on Learning to Love Ember’s Dependency Injection…

Breadcrumbs in Ember.js

After searching for a way to display breadcrumbs with Ember, I was left disappointed with what I found.

I wanted something that would:

  • Be isolated, so I didn’t have to clutter up my ApplicationRoute or commit other such crimes.
  • Be flexible in how the breadcrumbs are named (e.g., I want to include some data from my models).
  • Be flexible in which routes actually display breadcrumbs.
  • Be flexible in which route a breadcrumb will link to (since it may not always be the same route).
  • Automatically update whenever the route changes, regardless of which template the breadcrumbs are placed in.

So, I wrote my own. Read more on Breadcrumbs in Ember.js…