Java to Kotlin Gilded Rose - Part 2 Refactoring to Composition

preview_player
Показать описание


00:00:00 Recap
00:02:13 Mutation to Calculation
00:05:17 More Calculations
00:17:09 Subclasses to Composition
00:23:20 More Composition
00:25:40 Remove Inheritance
00:27:56 Extract Named Strategies
00:30:43 Implement Conjured
00:35:13 Composing Functions
00:46:16 Removing Last Inheritance
00:44:05 Organise and Review

Рекомендации по теме
Комментарии
Автор

This is fantastic. I had never even thought about converting subclasses to functions.

mistymu
Автор

That was super interesting. Thanks a lo!

philippmayer
Автор

Now I understand why in Part 1 you didn’t also inline the names of the items (a Brie always had name=“Aged Brie”).
So I learned that if you want to end up with a more functional solution, with an intermediary polymorphism refactor step, you don’t want to touch the constructor of the base class.
I have to say, watching you slowly cut and paste instead of using inline magic, has made me rethink my usage of shortcuts when pair programming with people I know aren’t fluent with them.

TimSchraepen
join shbcf.ru