Why Spring Framework

Last year I had to shift my web application to some latest framework.
I decided to go for Spring Framework, EJB3 was also an option.

The reason why Spring was:

1. Spring was a well established Open Source
2. Spring provides all the configurations into XML where as EJB3.0 relies in annotations, in my scenario I am using WebSphere 6.1 which runs on JDK1.4 which doesn't support annotations.

3. Spring is a loosely coupled Framework You can decide your own stack. Whereas EJB is whole integrated package.

4. One major reason was You are not forced to use any Spring imports or rely on Spring classes. Dependency Injection combined with external meta-data helps to achieve this independence. So you can easily migrate. While in case of EJB 3.0 this is different.

5. One disadvantage of using annotations based EJB 3.0 is you need to change java source to incorporate any configurations whereas in case of spring you need to change XML file.