When we want to make the process of object creation more abstract or determine a certain type of object dynamically, we should consider using creational patterns. In addition, you can specify the order of field initialization or make the process of object creation more flexible. It's worth mentioning that since Kotlin has many more modern features in comparison with Java, the implementation of certain patterns may differ significantly. It's better to demonstrate this through the use of an example.
This section covers the following patterns:
- Builder
- Factory method
- Abstract factory
- Singleton