We can augment the behavior of an object without t...
# feed
d
We can augment the behavior of an object without the object itself knowing about it! In this video, we'll see why the Decorator Pattern is useful, we'll apply it in Kotlin using the classic GoF approach, and finally we'll modernize it with some of Kotlin's language features.

https://youtu.be/erWsXSqQ-CMβ–Ύ

πŸ‘πŸΎ 1
πŸ‘ 4
g
Loved the video thanks! Would you still recommend reading the book from GoF nowadays? Are you planning a 2nd book around design patterns in Kotlin by any chance? πŸ˜… Looking forward for your next live!
d
Thanks! I think the GoF book is a great read. At this point, it does require understanding it in its historical context. A lot of the principles behind the patterns are relevant to much of our code today, even for those who aren't doing OOP (or aren't doing it in the traditional way). But I'd definitely recommend approaching it that way - looking for how it can shape our understanding of design, rather than sitting down and just implementing the patterns verbatim. Haha, not sure about a 2nd book yet, but we'll see! 😁
πŸ™ 1
πŸ‘ 1
s
After reading both I would recommend Head First Design Patterns instead. The drawback is that it’s in Java, so my trainee needs to learn that, too (also for Clean Code). In that regard I could very well imagine a Kotlin Design Patterns book in the style of the illustrated guide as a replacement/successor of Head First Design patterns. πŸ™‚
g
Seems like the people are asking for a "Kotlin Design patterns illustrated" @Dave Leeds πŸ˜…
😁 3
kodee happy 2
s
I just wanted to state that if someone can do it, he does πŸ™‚
Dave is on a good way to become a legend like Kathy Sierra 😎
❀️ 1
d
Oh, wow - you all are very kind! 😁 Thank you so much! I've still got to button up the final illustrations and appendices for the first book before I can think about a second! But it's good to know that people are interested in the topic!
πŸ‘πŸΎ 1
πŸ‘ 3
r
IMHO, the GoF book contains a lot of exciting principles that are behind design patterns. However, as @Dave Leeds said, you need some context to know how programming languages evolved in the last 30 years to fully appreciate the book
s
I could recommend reading the GoF book after Head First to get a deeper understanding and more examples.
For example the Head First book explained the Abstract Factory using a pizza factory. I had some trouble the first time to grasp it. The original book explains it with different UI toolkits like Qt, GTK & co where a app can be build that has a common UI code and yet different displays. I used that knowledge to build my own multiplatform framework in the past with a shared UI logic and views for iOS, Android & JavaFX through adapters provided by a abstract factory.