#kotlin

3 articles

Making Invalid States Unrepresentable in Kotlin

Kotlin sealed classes and Arrow’s Either can eliminate entire categories of bugs at compile time. This article shows how to apply them to a hexagonal architecture domain model to make invalid states unrepresentable and turn hidden exceptions into explicit method signatures.

Software Design

Hexagonal Architecture With Ktor and Exposed

The same hexagonal architecture patterns that work in Spring Boot translate directly to Ktor and Exposed. This article shows how, and where a lighter stack makes keeping business logic free from framework concerns more straightforward than it is with Spring Boot.

Software Design

JUnit 5 With Kotlin for Java Developers

This article explores writing JUnit 5 tests in Kotlin and configuring them with Gradle Kotlin DSL. It covers Kotlin-specific syntax for assertions, parameterized tests, dynamic and nested tests, lifecycle methods, and handling static fields. Readers will learn how Kotlin’s features can make test code more readable while fully supporting JUnit 5 functionality.

Testing