You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the advantages of annotations-based DI is that it does not require to edit DI-related code, when parameters are added or removed from @Inject constructor. For example, Daggers consumes such changes automatically. It would be great to add such possibility to Koin.
With such approach we can remove argumentOne from SomeRepo's constructor or add argumentTwo without any changes in Koin's module definition.
The same can be applied to factory, scoped and other BeanDefinition creators. Moreover, it works well with any method references, not only with constructors.
Limitations
But there are limitations. There is no easy way to specify DefinitionParameters or Qualifier of individual dependency of the bean.
Feedback is welcome.
In comments.
The text was updated successfully, but these errors were encountered:
Hello!
Motivation
One of the advantages of annotations-based DI is that it does not require to edit DI-related code, when parameters are added or removed from
@Inject
constructor. For example, Daggers consumes such changes automatically. It would be great to add such possibility to Koin.Solution
One of the possible solutions may look like this:
With such approach we can remove
argumentOne
fromSomeRepo
's constructor or addargumentTwo
without any changes in Koin's module definition.The same can be applied to
factory
,scoped
and otherBeanDefinition
creators. Moreover, it works well with any method references, not only with constructors.Limitations
But there are limitations. There is no easy way to specify
DefinitionParameters
orQualifier
of individual dependency of the bean.Feedback is welcome.
In comments.
The text was updated successfully, but these errors were encountered: