Back to Browse

Java to Kotlin Gilded Rose - Part 1 Refactoring to Objects

5.2K views
Oct 18, 2021
1:03:58

The Gilded Rose (https://github.com/emilybache/GildedRose-Refactoring-Kata) is a classic refactoring kata, available in many languages. In this video series (https://www.youtube.com/playlist?list=PL1ssMPpyqocjo6kkNCg-ncTyAW0nECPmq) we start with the Java version (https://github.com/emilybache/GildedRose-Refactoring-Kata/tree/main/Java) and show how to migrate it to Kotlin as well as refactoring the procedural code into both object-oriented and functional styles. 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 Part 2 (https://youtu.be/ajl3dpNTdM0) takes the inheritance solution arrived at here and refactors it to use composition. The code is available at https://github.com/dmcg/gilded-rose-kata This video content supplements the O'Reilly book Java to Kotlin, A Refactoring Guidebook (https://java-to-kotlin.dev).

Download

0 formats

No download links available.

Java to Kotlin Gilded Rose - Part 1 Refactoring to Objects | NatokHD