kohesive / injekt

Dependency Injection for Kotlin
MIT License
235 stars 19 forks source link

How does this library compare to Dagger 2? #34

Closed netimen closed 8 years ago

netimen commented 8 years ago

What are the main pros and cons of this library over Dagger 2? Why should one choose injekt? It would be great to add a short section to README describing this

apatrida commented 8 years ago

Read the documentation for Dagger 2, then read the documentation for Injekt. If one makes more sense to you than the other, use it. Injekt is a object registry pattern where you are in complete control, and using default values for constructors that call Injekt, or initializing properties with Injekt or delegates of Injekt, you can easily build anything another dependency injection system can do but without anything being hidden. And it will also work in unit tests without even having to use injection if you layer things correctly. Again, because you are in complete control and everything is obvious. I don't use Dagger 2, never have, and didn't like the type of library it was when I read the docs so I moved on to my own.