Welcome to another installment of You May Not Need Another Library For That (YMNNALFT)! I've spent a lot of time since 2016 illuminating (or trying to, anyway!) some of the more enormous opportunities in the Spring ecosystem in my Spring Tips videos. Today, however, I come to you in a different spirit, wanting to focus on the little, sometimes hidden, gems that do fantastic things and that might spare you an additional third-party dependency and its implied complexity.
We've all been there. There's some everyday string-manipulation routine you want, so you extract it out into a separate abstract class and expose it as a static
method. Then, there's some factory method for building a java.util.Collection<T>
, so you extract it out into a separate class and expose it as a static
method. And eventually, you've got a whole collection of these things scoured about your codebase, and there's little to no cohesion across them. After all, there's just not that much to it, right? These are, essentially, only global functions, not really methods on stateful objects, …