Thursday, February 9, 2012

the Singleton pattern reviewed

Interesting approach to the singleton pattern in Joshua Bloch's book 'Effective Java' 2nd edition.


public enum Singleton {
    INSTANCE;
}

This simple idiom solves a lot of non-trivial problems, as synchronization or serialization. I do really like this approach -I had never thought about this option. 


What about you?



First and.. ¿last?

This is the first post. Let's hope it's not the last one :-)

State machines in JS

You can read in previous blog posts the reasoning behind state machines: they simplify and unify the way we define states and transitions i...