This design pattern is all about customization and creating objects that are similar but slightly different. To understand it better, we'll start with an example.
Prototype
Building your own PC
Imagine that you have a shop where you sell PCs.
Regular PC consists of the foll:
- Motherboard
- CPU
- Graphical card
- RAM
Most of your customers don't actually care what components you put in this PC. What they do care about is whether this PC will be able to run Magnificent Pilfering Car 7 at 60fps (which is frame per second).
So, you decide to build it like that:
data class PC(val motherboard: String = "Terasus XZ27",
val cpu: String = "Until Atom K500",
val ram: String = "8GB...