Java to Kotlin Gilded Rose - Part 1 Refactoring to Objects

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

Here we take the procedural Java code, convert it to Kotlin, then refactor into an object-oriented solution using inheritance to represent the different types of item.

00:00:05 Importing the Project
00:03:01 Approval Tests
00:10:03 Introduce Kotlin
00:18:33 Refactor to Understand
00:25:46 Introduce BaseItem
00:30:46 Subclass BaseItem
00:41:26 More Method Extraction
00:47:56 Operation Ordering
00:52:31 Checking the Spec
00:53:21 Expressing the Spec
00:58:14 Simplify
01:02:36 Review

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

This is the best refactoring video I have ever seen! Thanks for sharing ❤

mytubekt
Автор

That technique of simply adding `static` to the extracted function to see if other state of the original object was being used is SO simple, yet tells you SO much! 👏👏👏

TimSchraepen
Автор

Thank you. The most useful explanation I have heard yet

lucyseal
Автор

Thank duncan for your book and this suco great content, :)

fabricioaraujo
Автор

thank you! very interesting and helpful technique.
the single missed point: to code the mapping between name and class "Aged Brie" -> Brie() (some factory class?)

zmitrolapconak
Автор

Hello Duncan, I am a student who is currently studying Kotlin and Java. I was wondering if you could kindly share your opinion on whether it would be more beneficial to start learning from books or to watch your video lectures and complement my learning with additional resources from books. While I enjoy the comprehensive explanations in books, I also appreciate the practical examples demonstrated in your video lectures. Thank you for taking the time to read my message. I apologize for any mistakes in my English, as it is not my native language.

tom
join shbcf.ru