https://kotlinlang.org logo
#ktor
Title
# ktor
e

Evgeniy Zaharov

08/27/2019, 4:11 PM
Hi. Does
ktor
have any plans in future to implement a huge customization futures like
spring
project have? For example in spring exist inner DI with which you could in next configuration steps retrieve some bean from previous. Or in runtime replace any bean in context by creating it by yourself. For now ktor doesn’t contain any DI system internal and such cases is difficult to implement without it. And for now I couldn’t imagine how to implement something like spring starters which are comes with new beans inserting to context + bean post processors which could customize beans depends on conditions/previous creatated beans/etc. I don’t say that
ktor
is going by wrong way or what it’s had some invalid architecture constructions. Me really likes how it constructs internal. And I just want to know, is at ever possible to do something like in spring for ktor?
e

Evgeniy Zaharov

08/27/2019, 5:45 PM
Yes, I know that it's easy to use any external DI. I have say not about it, but about inner architecture with DI or another tool which could add possibility to configure inner configuration
g

gildor

08/28/2019, 6:49 AM
I think it goes against ideology of Ktor. Ktor is non-opionated, you have to use any DI what you want
e

Evgeniy Zaharov

08/28/2019, 7:26 AM
It may be not DI at all, but something which will add possibility to external libs configure internal configuration. For example one library add DataSource for DB, next lib find this DataSource and configure JPA around it, and etc. I know only solutions with internal DI like this do
spring
. But mb you may have any thoughts about how it could be done in ktor with another tool.
mb ktor may have some internal register very similar to existing with phase, from which in lambda in
install
section, be possible to store and retrieve some configured classes. But it again be like DI.
4 Views