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,…):

Class Diagram

Leave a reply

required

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">