May 2024
Intermediate to advanced
560 pages
16h 9m
English
This chapter covers
invoke conventionIn this chapter, we’ll discuss how you can design expressive and idiomatic APIs for your Kotlin classes through the use of domain-specific languages (DSLs). We’ll explore the differences between traditional and DSL-style APIs, and you’ll see how DSL-style APIs can be applied to a wide variety of practical problems in areas as diverse as database access, HTML generation, testing, writing build scripts, and many others.
Kotlin DSL design relies on many language features, two of which we haven’t yet fully explored. One of them you saw briefly in chapter 5: lambdas with receivers. ...
Read now
Unlock full access