Hi all, I have a config bean and a service bean, the service bean has two impl, I need to choose one service impl to register by the condition(using config to calculate the condition). How can I do? or maybe I can registry them all, and inject by condition, I don’t know how to do in koin also.
Songv
08/31/2021, 9:54 AM
maybe it likes the
@ConditionalOnProperty
in Spring.
s
Scott Kruse
08/31/2021, 3:57 PM
register both, inject 1 via named argument?
a
arnaud.giuliani
09/01/2021, 7:58 AM
you can consider a conidition at several place:
• in your definition function
• by injecting parameter for your condition
s
Songv
09/02/2021, 8:27 AM
thx, I register both, and inject 1 via name. same as @Scott Kruse