Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Kotlin Design Patterns and Best Practices
  • Table Of Contents Toc
Kotlin Design Patterns and Best Practices

Kotlin Design Patterns and Best Practices - Third Edition

By : Alexey Soshin
4.9 (26)
close
close
Kotlin Design Patterns and Best Practices

Kotlin Design Patterns and Best Practices

4.9 (26)
By: Alexey Soshin

Overview of this book

For developers who are working with design patterns in Kotlin, this practical guide offers an opportunity to put their knowledge into practice. The book covers classical and modern design patterns, and provides a hands-on approach to implementation, along with associated methodologies. The third edition stays current with Kotlin updates, spanning from version 1.6 onwards, and offers in-depth insights into topics like structured concurrency and context receivers. The book starts by introducing essential Kotlin syntax and the significance of design patterns, covering classic Creational, Structural, and Behavioral patterns. It then progresses to explore functional programming, Reactive, and Concurrent patterns, including detailed discussions on coroutines and structured concurrency. As you navigate through these advanced concepts, you'll enhance your Kotlin coding skills. The book also delves into the latest architectural trends, focusing on microservices design patterns and aiding your decision-making process when choosing between architectures. By the end of the book, you will have a solid grasp of these advanced concepts and be able to apply them in your own projects.
Table of Contents (19 chapters)
close
close
Lock Free Chapter
1
Section 1: Classical Patterns
6
Section 2: Reactive and Concurrent Patterns
11
Section 3: Practical Application of Design Patterns
16
Assessments
17
Other Book You May Enjoy
18
Index

Sequences

Functional programming languages have long featured higher-order functions for collections. However, for Java developers, this concept became significant with the introduction of the Stream API in Java 8.

The Stream API offers useful functions like map(), filter(), and others, but requires converting your collection into a stream to use these operations. To obtain your collection again, you would have to collect the stream again. This can lead to an OutOfMemoryError if the stream is infinite, though.

In Kotlin, sequences serve a similar purpose to Java streams. Kotlin’s alternative is called a sequence just to avoid naming conflicts with Java streams, for projects that mix Java and Kotlin code together, or that depend on Java libraries. Unlike Java streams, which are specific to the JVM ecosystem, Kotlin sequences are not restricted to the JVM.

Sequences offer a blocking API to a potentially infinite stream of data.

Creating a new sequence in Kotlin...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Kotlin Design Patterns and Best Practices
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon