If you're interested in functional programming, you might also want to checkout my second blog which i'm actively working on!!

Wednesday, January 29, 2014

Code puzzler: Tape Equilibrium

Suppose you get an array of ints of arbitrary length. Now we need to find out what is the mimimal absolute difference of the 2 sums of numbers if you split the array at any position in a left and right array. And preferably in a efficient way.

Friday, January 10, 2014

AxonFramework - initial exploration

For the record, this demo is kind of copied from the quickstart but it is in some ways more elaborate and using the latest and greatest version 2.0.7
Now we start thinking about the behaviour of our little demo application. A user can create a new todo item and he can mark an existing item as completed.
When commands are issued, something is bound to happen, so we also need to think about what events occur.
We also need to think about our aggregate, in this case our ToDoItem
Of course we need to test if events are properly created when a command is issued.
We also need to configure the application, as usual we will use Spring to wire our app.
The demo app just issues 2 commands, mimicking what a user might do. And to make it interesting we also create an event handler for our ToDoItem events.
When we run the ToDoApplication we notice a file gets created in c:/tmp/axondemo/ for our aggregate called TODO-1.events. Also we nicely see some output appearing in the console:
We've got something to do: Clean house (TODO-1)
We've completed a task: TODO-1

Friday, January 3, 2014

Caching - the pitfall

At a current project we added some caches to our application to improve performance. However, we faced some issues I looked into and this article will demonstrate you should use caches with great precaution.