By now, you should be very familiar with using Kotlin to access existing APIs. In this part of the book, you’ll learn how to build your own APIs in Kotlin. It’s important to remember that building APIs isn’t restricted to library authors: every time you have two interacting classes in your program, one of them provides an API to the other.
In chapter 9, you’ll learn about the principle of conventions, which are used in Kotlin to implement operator overloading and other abstraction techniques such as delegated properties. Chapter 10 takes a closer look at lambdas, and you’ll see how you can declare your own functions that take lambdas as parameters. You’ll become familiar with Kotlin’s take on some more advanced concepts, such as generics (chapter 11) and annotations and reflection (chapter 12). Also in chapter 12, you’ll study a fairly large real-world Kotlin project: JKid, a JSON serialization and deserialization library. And finally, in chapter 13, you’ll reach one of Kotlin’s crown jewels: its support for building domain-specific languages.