If you want to learn how it works, what are its perils and dangers, read the article written by Marcin Moskała ➡️ "Use the data modifier to represent a bundle of data".
Prefer composition over inheritance - Reflections on when should we use composition and inheritance in Kotlin by @Marcin Moskała
Years of OOP made us overuse inheritance. Instead, we should more often use composition, that is safer and more explicit. More often, but not always...