Chapter 2: Working with Creational Patterns

In this chapter, we'll cover how classic creational patterns are implemented using Kotlin. These patterns deal with how and when you create your objects. For each design pattern, we will discuss what it aims to achieve and how Kotlin accommodates those needs.

We will cover the following topics in this chapter:

  • Singleton
  • Factory Method
  • Abstract Factory
  • Builder
  • Prototype

Mastering these design patterns will allow you to manage your objects better, adapt well to changes, and write code that is easy to maintain.

Technical requirements

For this chapter, you will need to install the following:

Get Kotlin Design Patterns and Best Practices - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.