Transformatorhuis

August 30, 2009

Crafting Code with Test Driven Development

Filed under: Uncategorized — Tags: , , , , , — cyberroadie @ 6:57 pm

I just finished doing every exercise of Agile Java: Crafting Code with Test-Driven Development by Jeff Langr.

You can find the solutions to all the exercises in my Git Hub repository.

Install git (version control system) and use the following comand:
git clone git://github.com/cyberroadie/spikes.git
to check out the code.

The exercises are not indexed but I added tags (Lessonxx) for every chapter I finished. There are 3 main parts: The chess game, the exercises you can find at the end of every chapter and some exercises I did whilst reading the chapters.

Although Jeff did use JUnit 3 and Ant in the book, I used Maven and JUnit 4 instead.

Please feel free to use this code and I’m happy to receive any updates/patches/improvements :-)

Happy Coding :-)

Olivier

August 26, 2009

What and When with Multithreading

Filed under: Uncategorized — cyberroadie @ 9:15 pm

Stating the obvious: multi threading programming complicates the developing task by adding ‘when’ to the ‘what’ I want program task.

With Java safely doing this ‘when’ can be achieved by programming like this:

public void run() {
        while (alive) {
            synchronized(monitor) {
                monitor.wait(timeout);
            }
            doSomething();
        }
}

I personally find this ’synchronized’ a bolt on solution, it’s a bit like memory management in C++, you have to think about it whilst you put you program together, not necessarily a bad thing, but it would be nice if it was done for you, like garbage collection in Java.

Now I wondered if there is a language which has the added feature of dealing with the synchronization for you? And if a language like that exists would this generate an overhead during execution? What would the syntax (if any) be like?

Maybe time to look at Erlang which follows the Actor Model for it’s concurrency.

August 12, 2009

Contribution to maven-glassfish-plugin project

Filed under: Uncategorized — Tags: — cyberroadie @ 5:09 pm

Contributed to the maven-glassfish-plugin
Added a missing parameter (–force) for glassfish deployment, filed an issue and uploaded the diff: http://jira.ocean.net.au/browse/MGP-21

Blog at WordPress.com.