Menu

Entities and Values

May 04, 2010

In object-oriented programming, defining new classes of objects is the typical way of introducing new types. It is extremely important to classify these types in order to ensure separation of concerns. In this article, I am going to define two common classes of types, namely entities and values. Entities are objects of the domain model,… Read more

Ids and Ambiguous Method Parameters

March 14, 2010

You’ve probably run into a method with a signature like: void addToGroup(long userId, long groupId) and a common question you might ask yourself is, “Oh, was it the user id first, or the group id first? I always forget. Stupid method.” You’ve encoded the meaning of the parameters into their names, and hence you need… Read more

Voldemort in the Wild

February 02, 2010

At kaChing, we’ve tried to embraced as much of the lean startup methodology as possible. In keeping with the spirit, we’ve worked to scale our infrastructure smartly, using data to drive our decisions and discarding speculation. As part of our infrastructure, we’ve embraced Project Voldemort as a highly performant and reliable data store. One experiment… Read more

Actually Implementing Group Management Using ZooKeeper

January 09, 2010

ZooKeeper offers, in the words of its documentation, “off-the-shelf… group management”. The “off-the-shelf” part is inaccurate; it really offers the proper primitives to *implement* group management, but it’s up to you to fill in a few missing pieces. I’ll be describing one type of group management system I built at KaChing using ZooKeeper: A group… Read more

emptyList(), emptySet(), emptyMap()

December 08, 2009

This is the first in a series of posts on under-utilized Java collection types and idioms worth adding to your Java vocabulary. Top 5 Under-utilized Java Collections #1: Empty Collections Every Java programmer has at least once declared a constant to represent an empty collection. It might have looked something like this: static final List<Result>… Read more

Parsing Java annotations

November 19, 2009

At kaChing, we are on a 5-minute commit-to-production cycle. To achieve this extreme iteration cycle, we are running a series of very fast analyses on our code base. From discovering bad code snippets to detecting missing Guice‘s bindings, these tests strive to catch common mistakes due to distracted developers, new hires or bad APIs. As… Read more