My good mate Paul (no blog – no link!) pointed me towards this little gem yesterday: Flat3Map. It’s a hash table optimized to 3 or less entries. It’s a great example of building a lean solution to a precise problem.
Java’s obsession with the Abstract Factory Pattern is often and rightly bemoaned so it it’s great to see such a nice counterpoint. Frameworks like Spring, although they minimize ripple effects, add to a constant deferment of responsibility which leads to it own problems.
Anyway I’ll certainly wistfully remember Flat3Map next time I think about abstracting away some pesky implementation details.