I have most experience in Java and Spring DI. When...
# koin
e
I have most experience in Java and Spring DI. When I started using kotlin and koin (for a little side project) a few weeks ago, there were two issues that almost put me off: 1. DSL vs. annotations The DSL feels laborious and a bit clumsy - it reminds me of the early days of Spring were you needed to define components in xml. I am used to slap on
@Component
on a class and be done. When I need an instance in another component, then I just declare a constructor with a parameter of that type. On second look I found koin annotations. However, • the docs put still the DSL first and annotations are even explained in terms of the DSL configuration. Why is that? Can't we emphasize annotations more? Or are there distinct advantages of using the DSL? • even in the annotations tutorial we still need
by inject()
- can we get rid of that? Maybe make the
UserApplication
a koin component, too and tag it with
createdAtStart=true
? When browsing the internets koin often gets a bad rep because you (supposedly) must use
KoinComponent
,
by inject<>()
,
get()
, ...