https://kotlinlang.org logo
#random
Title
o

orangy

12/16/2016, 2:55 PM
I think DI is a principle, and frameworks are there to automate using this principle. So, given I have classes designed for DI without any annotations and none of framework pollution, I want to replace application composition by hand like this:
Copy code
fun main(…) {
   val x = X()
   val y = Y(x)
   val z = Z(x,y)
}
with some call to composition engine and that’s it. Whatever you can’t do with plain composition of instantiating classes, shouldn’t be done by DI framework.