On Spring

by

I recently attended a 3 day training on the Spring framework. The instructor observed that Spring basics include the Inversion of control container and aspect oriented features of Spring. He also covered the use of Spring in the data access layer and for transaction management. He noted that Spring's transaction management supports nested transactions that EJB does not. So, EJB still lacks something that Spring offers.


He also explained that Spring is perhaps the only framework that has utility in almost all layers of a web application as it extends from the presentation tier to the integration tier. All other enterprise java frameworks target one layer and that increases the investments required to learn the complete set.

I think one major feature that he failed to mention is the support for mocks that Spring provides. The creators of Spring clearly mention that they value testability. Take for instance a simple web application I was trying to create just now. Without Spring's support for testing, I would have to start Tomcat, deploy the application and then see if it worked or not. With Spring, the package "org.springframework.mock" provides me all the support I need, so I can create a test and work with servlets without an application server.

The training did not include Spring MVC, which is the equivalent of Struts, so that was a little disappointing. He also made only a passing reference to WebFlow. Another concern is that we couldn't get much hands on practice at the training, since the feature set of Spring is huge, so it was always a little rush-rush. Still, I would conside it time well spent.