Design patterns are a powerful tool for a software developer. They help to solve common problems, such as ensuring the uniqueness of a class instance or how to encapsulate and swap behaviors at runtime. Design patters also give us a common vocabulary with which to discuss architectural challenges and decisions.
In this chapter, we will revisit some familiar Java design patterns and see how those patterns can be reimagined while harnessing the power of the Kotlin programming language.
The following topics will be covered in this chapter:
- Understanding design patterns
- Revisiting the Singleton pattern in Kotlin
- Revisiting the Factory pattern in Kotlin
- Revisiting the Builder pattern in Kotlin
- Revisiting the Strategy pattern in Kotlin