Dead Simple Dependency Injection with Kotlin Default Arguments

Published: 23 September 2022
on channel: Pairing with Duncan
1,096
43

You don't need a framework to inject dependencies - DI is really just allowing dependencies to be specified rather than being baked in.

In order to test our unreleased pricing code we want a version of the app that differs from the production version. Instead of introducing a framework to manage the dependencies, we just extract a function that builds the app from its components, and use default arguments for the production configuration.

If you like this, you’ll probably like the book Java to Kotlin, A Refactoring Guidebook
http://java-to-kotlin.dev.


Watch video Dead Simple Dependency Injection with Kotlin Default Arguments online without registration, duration hours minute second in high quality. This video was added by user Pairing with Duncan 23 September 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,096 once and liked it 43 people.