Last Monday evening I joined the Java Study Group at the VIK’s house, near Antwerp, for a session about the Spring Framework. It was certainly worth the ride! Besides, Gerrit Cap kindly spoke in English instead of the usual Dutch. 🙂
I have made some research on Spring before, but with this session I could get a better understanding of the framework and its applicability. The idea was to learn the principles behind Spring and how to use the framework. Gerrit Cap spoke about decoupled OO implementations, which are easier to achieve with Spring. He touched other several subjects, including Inversion of Control and AOP.
It came as a surprise that Spring can be used in standalone applications. I thought it was more meaningful to use it in web applications, and the reason is that I usually read about Spring and its applicability in enterprise applications. I really liked that implementations can be done with less code than usual, eliminating duplicate code and promoting code reuse. I find imperative decoupling between objects, which is achieved in Spring by using Inversion of Control.
I liked more things of course! I find the JdbcTemplate fantastic. 😛 I am developing a web application in PHP where I have to do all the code to query the database myself: get a connection to the database, prepare the SQL statement, bind parameters, fetch the result and finally close the connection to the database. And I have to do this many times. JdbcTemplate does all this for you, which lets you actually concentrate on the query itself.
Another thing I find interesting is AOP. Although I had already used AspectJ last year at the Advanced Software Engineering course, while I was studying at TU Delft, I never understood very well the concept. It’s actually quite simple, and using it makes it possible to concentrate on the logic of the application and overlook logging, transaction, security or any other kind of concerns. These can be taken care later or even by another specialized developer.
In conclusion this was a great session, and I hope there will be more like this! In addition, Gert Cuppens offered me a DVD from JavaPolis 2004 with some nice presentations also about Spring and AOP. Ah! And the book “Agile Java Development With Spring, Hibernate and Eclipse” arrived today. Gotta keep running!