views:

609

answers:

6

I've been doing some Java development, and have learnt my basics. I would like to take my skill to the next level by learning frameworks that are mainstream.

I hear about Spring + Hibernate all the time. Lately, there has been some talk on Java EE with EJB 3 etc. I know there is a lot of war going on, but I'm looking for an answer.

I know it's difficult for others to make a choice for me, but if you can probably provide me with some tips/leads from which I can choose, that would be great!!

+2  A: 

Learning JavaEE helps you understand what a lot of other frameworks simplify/hide from you so learn JavaEE first, then learn everything else.

Esko
+1  A: 

Spring and Hibernate were good and lightweight alternatives to the model of EJB2. Nowdays the POJO based model was adopted also by Java EE. So I would start with JPA and EJB...

dfa
Isn't it more simple to learn a framework which was better designed from the beginning?
Bastien Léonard
I think that is better to learn what dependency injection is and how to use it, instead of a DI framework
dfa
+3  A: 

Don't forget that both Spring and J(2)EE are sizable frameworks, and I would perhaps cherry pick some key components e.g. (based on what I see customers using, and in no particular order)

  1. J2EE Servlets
  2. Spring IOC and configuration
  3. J2EE JDBC
  4. Hibernate

J2EE alone contains something like 15 different components and if you're not actively using these, then learning and retaining that knowledge is going to be very difficult.

Brian Agnew
+7  A: 

I think learning Spring framework is a great place to start. As you go through the online reference or a book like Spring In Action, you will learn programming concepts like Dependency Injection, Loose Coupling, Test Driven Development, etc, directly or indirectly. I think if these concepts are well understood and practiced, you can be very productive and effective in your software development.

To me, learning Hibernate was a little bit more difficult than learning Spring. Hibernate by nature of the problem it's addressing, may be a bit more complicated to setup and start using it, but for me, it was more to do with my lesser knowledge about the relational databases that hindered me from learning Hibernate quickly. Hopefully you would know enough about dealing with databases, not just writing SQL, but also the concepts of transactions, cascading, constraints, etc, so as you go ahead and learn Hibernate those concepts will become even clearer, and see the benefits and limitations of what an ORM framework can offer you. I think you should start with Hibernate core and Hibernate annotations, then, once you are fairly comfortable with object mappings, you can either go on with more advanced Hibernate specific topics, or it could be the right time to learn about JPA.

Learning JEE by itself can be a bit like trying to learn swimming without jumping into the water. At least it was like that for me. When I read the reference documents and tutorials, I did not have enough background knowledge to measure whether I actually understood it or not, let alone actually understanding it. And although they provided some examples, it was hard to apply those examples to the project I was working on. Learning Spring and Hibernate helped me to see what was happening in practice, and I could bite off small bits at a time and apply to the problems that I was working on straight away. If you have no problems in understanding JEE tutorials, by all means, go for it. But I just found it more difficult than trying out little bits of Spring and Hibernate here and there in my projects.

tim_wonil
+1 - and then when you move on to EJB3/JPA from hibernate it will be an evolution.
Michael Wiles
A: 

Here's where to start: servlets, JSPs using JSTL, and JDBC. You'll go a long way with just those.

I'd prefer Spring, because you can do all that using Spring MVC and JDBC template to get going. It'll be POJOs - easy to test.

duffymo
+2  A: 

Based solely on what I'm seeing in job postings, hearing about from recruiters, and being asked in interviews, I'd recommend Spring and Hibernate. Ymmv, but the market seems to have largely moved towards solutions using Spring and/or Hibernate, and away from J2EE.

CPerkins