Recent Posts
Transacter and Intent/Result
At SQ, we had a family of Transacter interfaces:
public interface Transacter { void transaction(Function<Session, Void> session); public interface Session { DSLContext dsl(); } } where DSLContext is a jOOQ concept & is the handle for doing work against the database. Then this would be used in some class like
public class KvDao { @Inject Transacter transacter; void put(String ns, String k, String v) { transacter.transaction(session -> { KvRecord record = new KvRecord(ns, k, v); session.
read more
hype channels
When I was managing a small team, one of the coolest protips I came across was the idea of a “hype channel”. This builds on the idea of a “hype doc” by changing the medium: instead of writing into a document, you write blurbs on your own private Slack channel.
I’m not sure whether this would help anyone but me, but maybe it’ll help someone else drowning in Chrome tabs?
read more
interceptors
INTERCEPTORS ARE SO COOL!
Sometimes you need some “generic rails” that are still highly adaptable to other uses. This is the basic problem solved by the Interceptor pattern.
I really love the way OkHttp does interceptors for the generic rails of making HTTP calls, so I wanted to walk through a case study of why an interceptor might be useful and then try to synthesize some lessons & a minimal example of the pattern.
read more