Dependency injection allows developers to have a standardized way of wiring up applications in different ways for different scenarios. While enabling modularity, customizability, and testability, dependency injection has also been criticized for being too magical, too easy to go wrong at runtime, and unnecessary.
In this presentation, Jaro Regec presents several options for dependency injection in Scala, highlighting the strengths and weaknesses of each, and then discusses how you can use ZIO 2 for dependency injection in a best practice way, without overusing ZIO Environment.
Learn how to create modular, customizable, testable code, without boilerplate, and with compile-time failures for missing dependencies, using ZIO 2.