Preface

Kotlin and Python are my favorite programming languages. After publishing Kofiko configuration library for Python, I decided to work on a port of it for Kotlin. Actually the porting to Kotlin took significantly more effort, for many reasons. I wanted to introduce better extensibility architecture this time, I wanted the library to support more formats, and also due to many conceptual differences between Kotlin and Python. For example, Kotlin Annotations can contain metadata only, and Python Decorators can contain logic.

Other challenges involved were how to discover configuration objects, how to design a fluent API for adding configuration layers (providers), and a lot of reflection work.

Though I tried to keep the library clean from any external dependency, I finally settled on a single dependency in the well-known jackson.core (ObjectMapper) library, in order to be able to reuse string parsing ability of Jackson without having to write many type converters.

#ini #libraries #json #kotlin #configuration

Code-First Configuration Library for Kotlin
1.35 GEEK