My shot at the GildedRose refactoring Kata, created by @TerryHughes and ported to Kotlin by @emilybache. Original requirements: GildedRose-Refactoring-Kata repository.
- Open project with IntelliJ IDEA Community edition
- Navigate using the Project viewer to
src > test > kotlin
- Right click on "🗂 kotlin" and pick "▶ Run all tests"
Since it is specified as a project requirement to keep the Item class unchanged,
it could be considered that the ItemUpdaters
class violates the OCP principle.
Lifting this specification would allow to move the updating logic in the typed items
which would implement an Updatable
interface, and thanks to polymorphism this
would further simplify the program and add to its readability and maintainability.
Distributed under the MIT license. See LICENSE for details.