Sep 2 2010

Spring to the Rescue


The project I am working on these days, at office, uses Spring extensively. We use Spring for mainly to implement dependency injection and recently Spring transactions was tested to use for database transactions. One thing I love about Spring is the amount of flexibility it supports and the features it provides. I am not a Spring master, but the days I spent with Spring made me love it more and more.

During the last sprint iteration (we use the Scrum process for this project) we decided to go for a new algorithm called Nested Interval Set (NIS) to achieve efficient database searching. Doing so required a complete changeover in the back-end services to support this new algorithm and we needed to merge it with the existing code so that nothing will break. With Spring this was a breeze!!

Our services are always implemented for interfaces and in this case also we had an interface for the particular back-end service. All we did was create the new back-end service (implementing the same interface) which supported NIS and injected it using Spring by just changing an XML entry where the Spring beans and dependency injections are defined. The changeover was that simple. If we had not used any dependency injection techniques a change like this would mean a lot of cumbersome work for the developers. If you want to know the basics of Spring, just go through this simple tutorial and get to know the wonders you can do with Spring in your projects.

Spring certainly is a life saver!!!! 🙂