Update your Ubuntu to Java 7
Nov 07, 11 by Juan Lebrijo about Java, blog
Download last release from oracle.com, I downloaded jdk-7u1-linux-x64.tar.gz. Unzip it: tar xvf jdk-7u1-linux-x64.tar.gz Copy to right place: sudo cp -r jdk1.7.0_01 /usr/lib/jvm Create java7 alternative: sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_01/jre/bin/java 1 Choose the alternative: sudo update-alternatives --config java You can choose between many jvm's easily. enjoy!!
Fizz Buzz Java kata
Nov 01, 11 by Juan Lebrijo about agilism, Java, Eclipse, blog
At XPWeek2011 we learned TDD coding, and the importance of OOP principles to develop applications. I spent great days there, thanks to Carlos Ble and iExpertos. Continuing with the last kata series. I will show you how I solved FizzBuzz kata, maybe not the best, but I like the solution because the expressive final code:
  • say(FIZZ, WHEN_FIZZ_FACTOR);
  • say(BUZZ, WHEN_BUZZ_FACTOR);
  • elseSayNumber();
Here you have KataFizzBuzz Here you have the code: fizzbuzz.zip And here you have the video:
Roman Numerals Java kata
Oct 16, 11 by Juan Lebrijo about UML, methodologies, Java, blog
Siguiendo con la serie de katas, ahora toca la kata de los números romanos. Es simple, se trata de convertir de entero a romano y viceversa. Para darle una vuelta de tuerca me he propuesto seguir los principios KISS y SOLID, que se recomienda tener en mente cuando refactoricemos. Y ya de paso me he propuesto implementar una Interfaz fluida basada en métodos estáticos:
  • convert(roman).toArabic();
  • convert(arabic).toRoman();
El video de la kata lo teneis en Youtube: El código de la kata aquí: romannumerals-fluentinterface-solid.zip Y por último un diagrama de clases que ilustra como el diseño respeta el diseño Open/Close, en tanto en cuanto fácilmente, añadiendo más subclases, podremos ampliar a tantos sistemas numéricos como queramos (Octal, Hexadecimal,...):
model.png 10.5 KB