Hi, Could any body tell me the significance of learning these frameworks like Struts/Hibernate/Spring etc vis-a-vis J2EE. Is it like you learn J2EE well and then you can pick up these frameworks easily or is each frame work an effort in itself. If somebody could correlate these frameworks to J2EE I would be extremely grateful. I am just beginnign to learn J2EE and all I hear in the market is Spring/Hibernate etc...
A Professional is one who can work best when he doesn't feel like it!
J2EE encompasses a bunch of different technologies (or, more precisely, specifications for technologies), for all the different layers of an application. It includes servlets, JDBC, JSP, EJB, JMS, etc. There's also an overall notion of how these pieces should work together. Sun promotes the idea that you have to take the entire package, all-or-nothing. But this isn't true: some people use everything but substitute a different view technology for JSP. On other hand, most people using Spring still use JDBC and Servlets.
In principle since various alternatives have to solve the same problems, there will be some ideas that carry over. But in many cases the details a different enough that transisitioning from one to the next won't be that much easier than started from scratch, at least the first time you do it. (After you've done it a few times, it gets easier, just like learning your fourth foreign language is easier than learning your second.)
So what to learn first? I think some of the J2EE alternatives like Hibernate and Spring are simpler and therefore probably easier to learn. On the other hand there is less choice for books and other learning material.
I would say that you should know the principle pieces of the J2EE framework before learning the alternatives. Know how everything, in Sun's ideal world, would fit together architechually. Then when you have that understanding, deal with specific frameworks that you have interest in or will be able to use. For example, if Struts/Tiles is something you are interested in, start using it to create your pages. Or since, the project I am on is unable to use Hibernate, I haven't taken the time to learn it.
But I would try to have an understanding of J2EE, it will help in the long run, after all, new frameworks are replacing old ones all the time. Just my 2 cents.
I will second Stefan's advise. In fact I will say that this was the way I've done it (but I must admit that in my case it was determined by the time: i have learnt j2ee firstly, cause at that moment there was no Spring, Behave, or any other IoC/DI lightweight containers). But when starting using Spring I have easily identified the issues/features they where addressing.
this is my fault i lead you to believe these are j2ee alternatives b/c they are NOT. They are j2ee frameworks - Spring, Struts, WebWorks etc. Now Hibernate, i think, is a jdbc framework. These frameworks are not the recommended way to use j2ee by sun. But they all use the j2ee API. But I will say, if you learn the blueprint of j2ee, it will make it easier to use all these frameworks. Sorry if I confused you with my previous post.
Unfortunately Stefan this time I have to disagree with you: none of the above mentioned frameworks (Spring/WerbWorks/Hibernate/Struts) are *not* conforming to any of the J2EE specs. Maybe you can consider some of them de facto standards, but they are not developed according to the specs.
Spring and Struts, etc. are J2EE compatible in the sense that they utilize parts of J2EE, such as Servlets. You can use them in a J2EE Application Server fairly easily. But they're not J2EE compliant in that they're not implementations of any of the official J2EE specs.
But they do use the J2EE API and b/c of this I would be more app to call them an extension of J2EE rather than an alternative. When I think of an alternative, I think of something that has no connection to the J2EE.