Showing posts from July, 2007

This Blog Has Moved!

Right, so yes, five years ago I moved to github pages, and never bothered to redirect any of these pages there. Now I've moved on from there, and... Finally I am using my real domain, . My blog is now at .  See you there!

Validation with Spring Modules Validation

So if java generics slightly disappointed me lately , what have I found cool? I'm currently working on a web application using Spring MVC , which probably doesn't come as a big surprise, it seems to be all the rage these days. Since this is my baby, I got to call the shots as to a lot of the framework choices. When it came to looking at implementing validation, I refused to believe I'd have to go through the primitive process of looking at all the values on the request and deciding if they pass muster, with some huge if statement. Even with Spring's rather marvelous binding and validation mechanisms to take the worst of the tasks off you, it still looked like it would be a bit of a chore. Given all the cool things you can do with AOP etc I figured someone somewhere must've implemented an annotations-based validation plugin for Spring. And they have . And there's actually a reasonable amount of information about how to set it up and get it working. The pr

Java Specifics

When I first started playing with Java 1.5, I thought generics were the best thing since sliced bread. No more untidy casting, lovely type-safe Collections, and when combined with the new for loop , a lot of the tedious tasks associated with Collections became easier and, most importantly, aesthetically pleasing. Consider the old code: List list = new ArrayList(); list.add(new Integer(1)); Integer integer = (Integer)list.get(0); for (Iterator i = list.iterator(); i.hasNext(); ) { Integer number = (Integer); number.intValue(); } And the new: List<Integer> list = new ArrayList<Integer>(); list.add(new Integer(2)); Integer integer = list.get(0); for (Integer number : list) { number.intValue(); } See? Much prettier. OK so it's a silly little example but when you apply it to all the places you use things like Collections it does make life a lot easier, especially when you consider that now you *k

Popular posts from this blog

Dissecting the Disruptor: What's so special about a ring buffer?

Dissecting the Disruptor: Writing to the ring buffer

Dissecting the Disruptor: Demystifying Memory Barriers