Strategy Pattern in Kotlin

Strategy Pattern in Kotlin

The Strategy pattern creates a family of algorithms, enclosing the differing logic in separate classes while hiding it from clients behind the interface. It enables the interchangeable use of implementations. The use of the strategy simplifies the customer code, avoids code duplication and conditional statements. Significantly simplifies testing - by separating client testing from strategy algorithms.

[Read more]

Kotlin Static Factory Methods

Kotlin Static Factory Methods

Static Factory Methods known from Java have their place also in Kotlin, although they look and behave a bit different because there is no static word in Kotlin. Here I’ll try to show how to use companion object for Static Factory Methods and more. PS: This whole post was supposed to be about Factory Method with just a short mention about static factory methods, but the topic becomes more interesting than I thought :)

[Read more]

IntelliJ settings repo

IntelliJ settings repo

I’m using a few computers (and few OS-es) where I run IntelliJ Idea and Android Studio, and keeping their settings the same way everywhere was always a bit painful. Until today when I learned about settings repository thing!

[Read more]