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

Luiz Aguiar

08/02/2022, 2:46 PM
Hello folks… I'm giving a try to Ktor again and one aspect that still making me wonder, is related a how "properly" design an application without relying in DI. In Quarkus/Spring, you inject component classes in other components (classes) and don't think much about it, it "just works". What might be a good design approach to use in a Ktor application? Thinking that you might have a couple of "components" that might be used for other components and of course you don't want to have multiple instances spread around. I've been trying to use mostly independent functions, but not sure how "scalable" is this in a big application. Cheers 👋
f

FunkyMuse

08/02/2022, 4:48 PM
You can check out Koin, although manual DI is also scalable
p

PoisonedYouth

08/02/2022, 6:59 PM
Koin is a lightweight solution, not bringing too much overhead
l

Luiz Aguiar

08/02/2022, 8:15 PM
But what's the "Ktor away"? I know Koin but was trying to see how could people use Ktor without bringing external DI libraries.
f

FunkyMuse

08/02/2022, 8:42 PM
Extension functions and context receivers combined
l

Luiz Aguiar

08/03/2022, 8:22 AM
@FunkyMuse any sample on GitHub to have a look?
f

FunkyMuse

08/03/2022, 4:34 PM
@Luiz Aguiar i was working on something but kinda abandoned it because didn't have time to finish it due to life reasons Other than that I have no idea
4 Views