This post originated from an RSS feed registered with Java Buzz
by Marc Logemann.
Original Post: Should i "Spring" in the cold MVC water?
Feed Title: Marc's Java Blog
Feed URL: http://www.logemann.org/day/index_java.xml
Feed Description: Java related topics for all major areas. So you will see J2ME, J2SE and J2EE issues here.
In the last 4 days, i spent about 25 hours reading about Spring and its different layers. Why reading that much upfront? The answer is easy, in the next 4-6 months, i am starting developing a product that should work on more than one platform and Spring seems to be a very good foundation. So basically its clear that i will use the IoC part of Spring to bootstrap my business objects.
To be honest, half a year ago, i thought that Spring would be just another hype like many other frameworks and technologies in the past but i am glad that i took the time to get the complete picture by reading a lot of material, especially the book from Rod and Juergen. I love that simple XML configuration style when it comes to beans and its dependencies. Another great thing is the AOP implementation and the declarative transaction management.
So using Spring in general is decided. But i have a few headaches with Spring MVC. Not because the MVC part is not good, in fact it seems superior to Struts, but i cant use my prefered JSP components called Common Controls which are strictly Struts focused with special Actions. Of course i could buy the source license and recode that API to be Spring MVC compliant, but i thought about buying it in the first place because i dont need to touch this kind of standard view components likes tables, trees and more. So again, this is not a Spring MVC issue but a personal framework combination problem.
The integration of Struts should be no problem with Spring, but of course i read about Spring MVC the last days and there are great value adds compared to struts. For example i could AOP my actions in Spring (i know they are not called actions) and have a lot more control how i want to do the mapping between actions and views. Plugability to Views seems also easier than with Struts, even though i dont know if its that important.
Of course i could use both (Struts + Spring MVC), depending on the type of actions i want go through and the kind of display data. But this could be a little bit confusing in the long run. I will have to work this out in the next hours.
One comment to my current picture of Spring after really reading a lot of stuff: I am impressed how plugable this beast is. I have the feeling that you are not being forced to do it the way someone wanted it, instead you have a lot of Interfaces for all kinds of daily business, where you can plugin your own implementation. Another interessting thing is that a lot of implementations are actually there for all kinds of choices like persistence solutions, MVC dispatching mechansim and more. One could think that Spring is at least 10 years old.
There are minor questions that wont affect my actual choice but which could be important in 1-2 years with my application, like how to deal transactions with 2 databases inside my ORM layer or the need to go via JCA to use SAP. This could be point of time where i nevertheless have to go via full-blown AppServers, but thats not something i have to solve today and Spring doesnt hinder me using an AppServer at all.