Posts

Showing posts with the label spring

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, trishagee.com . My blog is now at trishagee.com/blog .  See you there!

Amazing!

Today, I found my own blog useful.  I was configuring Spring validation on my new project, and had to remind myself how to do it .  We configured validation on the new project in less than an hour, which beats the two days it took me to work out how to do it the first time. And I impressed one of my new work collegues.  Apparently I am now the Spring Guru.  Oooops.

AOP Caching

Today I would like to document my experiences implementing caching with Aspect Oriented Programming (AOP) and annotations.  Background context   Caching may need to be implemented in your application for a number of reasons. OK, actually usually only one: performance. I would like to add my own tuppence-worth to this though - if you can get away without caching (specifically in application that provide the ability to view and change data) then do so, unless you are using a cache implementation that will handle as much of the pain as possible for you. Implementing a home-grown cache from scratch is almost never the correct thing to do in my experience, you spend lots of time debugging and tweaking the cache when you should be working on your day-job, not re-inventing something that someone, somewhere, has already done a perfectly good job of .  The example I'm about to show you is for a web application created to let users read and edit values from a database (not an unusu...

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...

Popular posts from this blog

Dissecting the Disruptor: Writing to the ring buffer

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

Dissecting the Disruptor: Demystifying Memory Barriers