I agree ktor looks interesting. I'd be interested in using the native version of that when the native compiler comes out of beta. IMHO that makes perfect sense for small microservices that don't need a lot of cpu and memory.
BTW. Spring is going to be supporting co-routines from 5.2 and with stuff like Flow, a lot of the reactive stuff they currently push is going to look pretty dated. IMHO Spring is very good facilitating Kotlin developers but you do end up with a lot of legacy complexity. Ktor does not have that problem yet.
Compared to Spring, Kodein is pretty verbose. What I like with Spring is that simply slapping a few @Component annotations in the right places causes Spring to do it's thing. Mostly explicitly instantiating things or autowiring them is done implicitly these days. The constructor for Bar expects a Foo instance and there's a Foo class with @Component means that spring creates and injects the instance for you without needing to be told to.
Kodein is a step up from DYI dependency injection of course but not a big one since it requires more ceremony. Spring uses a reflection which is not available on native or the js platform to automate the bits that you have to spell out with Kodein.
Software developer and programming enthusiast from Poland. I like to reuse and integrate good stuff, made by other people and available as open source. Kind of mainstream adversary ;-)
Like Spring this works only on the JVM. A multi platform injection framework would be needed long term. If, I'm on the JVM, I'd probably prefer spring for dependency injection since it is less verbose.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I agree ktor looks interesting. I'd be interested in using the native version of that when the native compiler comes out of beta. IMHO that makes perfect sense for small microservices that don't need a lot of cpu and memory.
BTW. Spring is going to be supporting co-routines from 5.2 and with stuff like Flow, a lot of the reactive stuff they currently push is going to look pretty dated. IMHO Spring is very good facilitating Kotlin developers but you do end up with a lot of legacy complexity. Ktor does not have that problem yet.
Compared to Spring, Kodein is pretty verbose. What I like with Spring is that simply slapping a few
@Component
annotations in the right places causes Spring to do it's thing. Mostly explicitly instantiating things or autowiring them is done implicitly these days. The constructor forBar
expects aFoo
instance and there's aFoo
class with @Component means that spring creates and injects the instance for you without needing to be told to.Kodein is a step up from DYI dependency injection of course but not a big one since it requires more ceremony. Spring uses a reflection which is not available on native or the js platform to automate the bits that you have to spell out with Kodein.
You can easily use Ktor with Guice. This way creating and injecting components is just as easy as with Spring.
Like Spring this works only on the JVM. A multi platform injection framework would be needed long term. If, I'm on the JVM, I'd probably prefer spring for dependency injection since it is less verbose.