Adapting Traits for Kotlin

A Macbook pro with code on the screen, a small notepad and blue ink gel pen.

Traits are a pattern introduced in Scala (at least, this was my first introduction to them) that help avoid deep class hierarchies in favor of composition. If you don’t have Scala experience, but do have Java experience, you can treat this similarly to Java 8 Interfaces. However, I still prefer to call them Traits. Although […]