Dependency Injection vs Functional

At work, we use dependency injection to build up small, decoupled classes each with a single responsibility. DI lets us assemble these in multiple different ways, so we can use the same class for similar processes. This strategy of combining small pieces of functionality in different ways is also a goal of functional programming. Let’s … Read moreDependency Injection vs Functional

Setting up an Android project in IntelliJ Idea

And there was pain… I imported an existing Android project into IntelliJ Idea Community Edition 10.5.1. Some things started complaining “Please select Android SDK.” The help pages are out of date; they say to do this in the Android facet settings. It isn’t there. Here is the secret do-things-right button: Module settings (ctrl-alt-shift-S), then pick … Read moreSetting up an Android project in IntelliJ Idea

Debugging Log4J: where are my log messages going?

If you’re looking for interesting reading, this is not it. Today the question emerged: where are this test’s log messages going? Sticking a debug point somewhere and doing Logger.getLogger(“blah”), then digging into the resulting Logger object, revealed the answer. The Logger object had a parent member (a RootLogger), which had a member aai (AppenderAttachableImpl), which … Read moreDebugging Log4J: where are my log messages going?

Product vs Platform in Programming Languages

There’s a big rant floating around the internet this week about Products vs Platforms. Platforms are service-based, with layer upon layer of exposed and secured and throttled services, while Products give the user everything they need in a perfect streamlined form. That is, Products give the user exactly what the builder of the Product believes … Read moreProduct vs Platform in Programming Languages

Keeping Your Cache Down to Size

Guava’s CacheBuilder provides several options for keeping a cache down to a reasonable size. Entries can expire for multiple reasons, entries can be limited to a certain number, and entries can be made available for garbage collection. These options can be used individually or together. Each is simply one more method call during cache creation. … Read moreKeeping Your Cache Down to Size