Learning Android Development

Dagger 2 and Koin comparison

Android dependencies management frameworks

--

Picture annca by on Pixarbay

The two major dependencies management framework for Android today is Dagger 2 and Koin. They both help to auto-wire up the dependencies for the developer to reduce code boilerplate.

Both are them though meant for the same purpose, are structure distinctly different even at a usage level. Knowing their differences would allow one to make better choices which to pick when working on it.

Dependency Injection or Service Locator

Many have mistakenly treated everything that handles dependencies in as Dependency Injection. In reality, another framework is called Service Locator.

Dagger 2 is based on Dependency Injection

In Dagger, the dependencies is provided as it is, may it through constructor or injected a class (or own class, which I name it Self-Injection)

--

--