Book Image

Hands-On Design Patterns with Kotlin

By : Alexey Soshin
Book Image

Hands-On Design Patterns with Kotlin

By: Alexey Soshin

Overview of this book

Design patterns enable you as a developer to speed up the development process by providing you with proven development paradigms. Reusing design patterns helps prevent complex issues that can cause major problems, improves your code base, promotes code reuse, and makes an architecture more robust. The mission of this book is to ease the adoption of design patterns in Kotlin and provide good practices for programmers. The book begins by showing you the practical aspects of smarter coding in Kotlin, explaining the basic Kotlin syntax and the impact of design patterns. From there, the book provides an in-depth explanation of the classical design patterns of creational, structural, and behavioral families, before heading into functional programming. It then takes you through reactive and concurrent patterns, teaching you about using streams, threads, and coroutines to write better code along the way By the end of the book, you will be able to efficiently address common problems faced while developing applications and be comfortable working on scalable and maintainable projects of any size.
Table of Contents (13 chapters)

To get the most out of this book

In this book, we assume that the reader has basic knowledge of Java programming language and what JVM is.

It is also assumed that the reader is comfortable working with the command line.

A few command-line examples we use in this book are based on OSX, but could be easily adapted for Windows or Linux.

Download the example code files

You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packtpub.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Hands-on-Design-Patterns-with-Kotlin. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Kotlin's extension is usually .kt."

A block of code is set as follows:

var s = "I'm a string"
s = 1 // s is a String

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

var s = "I'm a string"
s = 1 // s is a String

Any command-line input or output is written as follows:

I would suggest: a guitar

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "One of the most common tasks for Java developers is to create another Plain Old Java Object (POJO)."

Warnings or important notes appear like this.
Tips and tricks appear like this.