Readers vs Constructors - Dependency Injection showdown

Adam Warski

18 Jun 2017.0 minutes read

This talk has been (or will be) presented at:

Like it or not, but how in-code dependencies are managed is one of the key decisions that we have to make when working on a project.

We've seen various approaches to Dependency Injection come and go. In Scala's early days, the Cake Pattern was quite fashionable; but there was just too much boilerplate. Instead, maybe we could just use plain constructors for wiring dependencies (MacWire)? Use a hybrid service locator (SubCut, Scaldi)? Or go fully functional, and use the Reader Monad; but is it really a replacement of Dependency Injection frameworks/libraries? Finally, maybe we should stick with proven Java-land solutions, like Guice (used e.g. by the Play Framework)?

Video

Blog Comments powered by Disqus.