Never miss a beat

Join my newsletter.

Tag: ktor

The Facade Pattern for Simple Dependency Injection

Published: 1/16/2019

I’ve been working on a Ktor api for a while now and found myself needing to make sure my routes had access to my repositories. Naturally, I sought out the advice of anyone who’s implemented Dagger with Ktor. After digging for a bit, I realized that it was completely unnecessary and likely overkill. Dagger works great on Android because you are tied to the constraints of the platform and lifecycles, but with Ktor I have control of the entire scope of my application. So I considered trying…

Controllers in Ktor

Published: 1/10/2019

Ktor is a microframework written in Kotlin. It’s focus is on building asynchronous servers and clients in connected systems. I’ve been using it predominantly for the “server” slice of that statement. I call Ktor a “microframework” simply because, while it’s opinionated, you have a lot of freedom in the way that you accomplish tasks within the framework. If you’d like to follow along, you can scaffold out a basic Ktor project via Intellij Idea or the online tool for generating a seed project…