October 19, 2011

Test Driven Development: Small tutorial

Some weeks ago I did a TDD presentation and for that matter I prepared a small tutorial of how to do it.
Details
  1. I used Robert Martin's approach to TDD.
  2. The example idea was taken from James Shore.
  3. The QueryString(built in the tutorial) component is a simple HTTP parameters parser.
Http Parameters format: http://myhos.org/test?param1=value1&param2=value2




SE books you must read: Effective Java

Although this book is kind of old, is still valid. All its concepts and best practices are still being used and its author is an authority in the development world > Joshua Bloch.

This was the first book I read when I got into professional development, and believe when I say that is one of the mandatory books to read if you want to write something functional in Java.


Effective Java at Amazon

PS: I would like to share the ebook version of it, but I'm not sure about the licensing/copying policies.

October 10, 2011

Why reading is important

I had a long conversation today with a very close uncle, he's one of the most knowledgeable persons I've ever met. He learned to read and write on his own, while working and raising a family.

Right now he's in his 70s but the topics he shares are amazingly interesting, starting from Greek mythology, wars, and ending up with urban legends.



Perhaps his wisdom is the result of many years of experience and living, but I couldn't say. So tonight I asked him about his stories, where they come from? how did you get so good at telling them? how can you remember so many things?

His answers were short and concise, most of the stories were taken from other people, some others are life stories where he was involved, and some others are taken from books. But at the end he told me something that I can't leave aside:

"No matter how long you live, the world is big enough to leave you abandoned if you don't cope with it, read as many books as you can. Because there's something  you can always rely when all your senses start failing, your memory. Sometimes it can trick you, but with a little of practice you can train that little bastard...".

That's something that always has intrigued me, I know a lot of people who reads because they have to, or because they don't know what else to do. Books are the best source of information in world (and digital books count as books), I can't understand how so many people can avoid history, stories, articles and tales just because they prefer to watch it on TV or when a movie is released. It's a waste of potential, human beings should know they environment and what's happened in the world before us, we have to learn history, science, literature, etc.

As the great Steve Jobs said once "Stay foolish, stay hungry".

October 2, 2011

Library management with Ivy

Back in the day, when I was a child, I used to manage all my project's libraries by hand, copying and moving everything I needed for a project into its respective folder.

I was happy with this for some time, but then I had to scale, handle several projects with a mixed set of dependencies. My original idea was to use a grown up tool like Maven, but its XML-hell led me out of it.



The alternative I chose is Apache Ivy, a dependency management tool that only does dependency management, and it's highly configurable (if you do it right).

In this way you can keep several projects linking a common libraries repository that is entirely handled by Ivy, you just configure it.

I recently updated some of my projects to this, the configuration files are quite simple and do all the work, including the Ivy-ant task installation if not available.

Ivy configurations for my Paginator-project

References