Continuing with kata series, here we have roman numeral kata. Simple, you have to convert roman to integer and integer to rman.
In order to improve other things I purpossed to follow KISS and SOLID principles. Also creating a Fluent Interface based on static methods:
- convert(roman).toArabic();
- convert(arabic).toRoman();
The movie on Youtube:
Kata code here: romannumerals-fluentinterface-solid.zip
Finally, a class diagram illustrating the Open/Close principle which I tried to follow, here we can add more numeric systems only by adding the corresponding Number subclasses (Octal, Hexadecimal,…):