In the previous chapter, we discussed the Prototype design pattern, which allowed for creating instances of classes with slightly (or not so slightly) different data.
What if we would like to create a set of classes with slightly different behavior though? Well, since functions in Kotlin are first-class citizens (more on that in a bit), you could use the Prototype design pattern to achieve that. After all, that's what JavaScript does successfully. But the goal of this chapter is to discuss another approach to the same problem. After all, design patterns are all about approaches.
By implementing this design pattern, we allow the user of our code to specify which abilities he or she wants to add.