Can someone please explain why everyone says that ...
# koin
s
Can someone please explain why everyone says that koin is a service locator and Dagger is a 'true' DI? I don't see any semantic differences in module definitions and what I understand from service locators is completely different from koin(sth like androids
context.getSystemService
)
e
have a look at this article to have a better understanding. https://martinfowler.com/articles/injection.html
a
I would say that the main difference to observe is the way you inject it an Activity here.
👍 1
in Dagger or Toothpick you would use
inject(this)
to locate your factory calss to set your properties
👍 1
In Koin, the
by inject()
expression is asking Koin to get the property
👍 1
after that, We encourage to do constructor injection through the DSL
👍 1