September 2018
Intermediate to advanced
386 pages
11h 17m
English
Whenever it comes to builder patterns in Kotlin, it's worth taking a pause to think about whether we really need the builder pattern. In this chapter, the builder pattern is used to create the ApiGatewayResponse object.
Now why we strongly feel that Kotlin kind of removes the need for Builder classes in most of the cases. The builder pattern says we have all the mandatory parameters as constructors, and the remaining non-mandatory parameters as the Builder class, within your main class.
Kotlin has a very powerful yet easy-to-understand feature called named arguments and default parameters. Like we saw earlier in the chapter, the default parameter provides the default value to any function parameter when they ...
Read now
Unlock full access