Leanpub, 2023. - 371 p.
This version was published on 2023-12-07.
You can be a developer - even a good one - without understanding the topics explained in this book, but at some point, you’ll need it. You’re likely already using tools made using features described in this book every day, such as libraries based on annotation processing or compiler plugins, classes that use variance modifiers, functions with contracts, or property delegates, but do you understand these features? Would you be able to implement similar tools yourself? Would you be able to analyze and debug them? This book will make all this possible for you. It focuses exclusively on the most advanced Kotlin topics, which are often not well understood even by senior Kotlin developers. It should equip you with the knowledge you need and show you possibilities you never before imagined. I hope you enjoy it as much as I enjoyed writing it.
Who is this book for?This book is for experienced Kotlin developers. I assume that readers understand topics like function types and lambda expressions, collection processing, creation and usage of DSLs, and essential Kotlin types like Any? and Nothing.
That will be covered.
The chapter titles explain what will be covered quite well, but here is a more detailed list:
Generic variance modifiers.
The Covariant Nothing Object pattern.
Generic variance modifier limitations.
Interface delegation.
Implementing custom property delegates.
Property delegates from Kotlin stdlib.
Kotlin Contracts.
Kotlin and Java type mapping.
Annotations for Kotlin and Java interoperability.
Multiplatform development structure, concepts and possibilities.
Implementing multiplatform libraries.
Implementing Android and iOS applications with shared modules.
Essentials of Kotlin/JS.
Reflecting Kotlin elements.
Reflecting Kotlin types.
Implementing custom Annotation Processors.
Implementing custom Kotlin Symbol Processors.
KSP incremental compilation and multiple-round processing.
Defining Compiler Plugins.
Core Static Analysis concepts.
Overview of Kotlin static analyzers.
Defining custom Detekt rules.
The structure of the book.
I decided that the chapters should have a flat structure; however, if you read the book from the beginning, you might notice that the order is not accidental. The first four chapters, Generic variance modifiers, Interface Delegation, Property delegation and Kotlin Contracts, explain Kotlin features that are commonly used yet are not well understood by most developers. The next three chapters, Java interoperability, Using Kotlin Multiplatform and JavaScript interoperability, describe the details of using different flavors of Kotlin. The rest of the book, namely the chapters Reflection, Annotation Processing, Kotlin Symbol Processing, Kotlin Compiler Plugins and Static Code Analysers, are about meta-programming, and each of these chapters builds on the previous ones.
True PDF