I have been working in Java, J2EE(Servlets, JSP, JDBC) for 5 years but new to EJB and Spring Framework both. I am planning to learn one of these two. Should I invest my time in learning EJB or learning Spring framework? What do you guys think would be the technology of the future?
In my opinion Spring and EJBs are not exclusive, but rather complementary technologies. They could work together very well though. On the other hand spring is an IoC lightweight container and by learning it you�ll get a glimpse of the EJB�s future. EJB3.0 will implement similar technologies, deprecating the use of jndi and lookup in order to access ejbs and will rather use the dependency injection techniques, similar to Spring framework. If I were you I would definitely look into Spring, but I�d also try to get a high level understanding of ejbs. Although it will get replaced almost entirely, there still are valuable concepts in ejb2.0 as well. As for the future, it seems hard to say today whether ejb3.0 will gain the market and win the competition against all these great open source tools available, but in my opinion it seems also hard to believe that it will entirely loose it. Regards.