Hi,
Is ResourceScope something that replaces Koin because of instantiation of classes in the
ResourceScope.dependencies
. I am trying to somewhat understand it. I am using Koin as DI in my backend, but am trying to migrate to somewhat somthing like the ktor-arrow-example.
a
Alejandro Serrano.Mena
09/17/2023, 8:33 AM
ResourceScope doesn't replace Koin, you should rather see it as a replacement for lifecycle/resource management (it takes care of calling your finalizers when needed)
Yes, we tend to stay away from "auto-injection" and we typically prefer to that ourselves manually.
From experience I've found it results in the same amount of boilerplate, but better performance. No reflection, or compile/runtime tricks needed.
It's also typically easier to follow since it's just vanilla Kotlin.