Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am trying to start learning the J2EE part of Java. But I don't know where to start. I am familier with Core Java and mainly, I want to learn JPA and basics of Hibernate and Spring Framework. The main reason for this is I am working on a project which is using all these things. And most of the code is being developed by some senior guys and I have to make some modifications in that. So basically I need to understand their code.

Can someone give me a sort of roadmap, like which things I need to know beforehand and in what sequence should I go? Any reference material, like links, books?

share|improve this question

closed as not constructive by Yannis Rizos Mar 8 '12 at 15:18

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Do these seniors have time to introduce you to what they have done so far? –  user1249 Jun 9 '11 at 6:39
    
@Thorbjørn Ravn Andersen: If I ask some doubt, he explains me that. But the thing is the code is moderately big (~10000 lines). So if I have to do anything, I have to go through many source files and many lines of code, which I guess cannot ask them to explain me completely. Basically I am not familiar with JPA and Spring Framework, and in general J2EE. So I was looking for some stuff which will help me understand how the whole thing works and the basics, so that I at least don't ask some stupid doubts. –  Learner Jun 9 '11 at 13:17
add comment

4 Answers

Whenever I want to learn a new framework/language, I usually whip up a small project that uses it. For a web framework, I have a common webapp that I write using it. It's simple and doesn't do much, but it has enough features that I need to take advantage of the more common parts of the framework (database, background jobs, mvc or whatever similar such). In fact, not long ago I took up the task of learning Spring/MVC+Hibernate. I don't know it all, certainly, but it gave me enough of a background that, when I don't know something, I know what questions to ask and how to ask them to get more information.

For web frameworks, I usually start with the simple "hello world" example provided for most frameworks. If it has a "guestbook" example (ie, to show database use), I follow up with that. From there, I just start adding the functionality I want in my learning application, beginning with the simplest. The idea being that I can figure out how to ask the right questions for the simple things. After I've done some simple things, I can then look at the more complex things and, with the information I've already learned, I can hopefully formulate the right questions to ask for them.

I recently started putting the code for such learning projects on sourceforge, if you're interested.

Edit: Donal's comment made we want to add... I didn't put the link in as an example for you to learn from. Rather, just as an example of me putting my code out there. If you want to really learn, you need to write the code yourself, not just read someone else's (in my opinion, at least)

share|improve this answer
    
+1: I do much the same except that I virtually never share the results on the grounds that I need to learn by doing and not just copying, and I assume that other people are the same. (OTOH, occasionally one of my experiments escapes into the wild and evolves into a real product.) –  Donal Fellows Jun 8 '11 at 15:14
    
Honestly, I started sharing for three reasons: 1) So that my code would live somewhere besides the local svn repository I have, 2) So that, when people ask for examples of my code in a specific technology, I can link them to it (previously I had no such code to show them), 3) When people ask questions of me on how to do something and I've done it, I can show them easier –  RHSeeger Jun 8 '11 at 15:17
    
+1. Thats a really nice idea. But this does not fully answer my question. Even for doing this, I have to start somewhere, but I don't know where. Scanning any topic randomly is not helping me. –  Learner Jun 8 '11 at 15:18
1  
Added a quick description of how I go about learning on web frameworks specifically; the path I take. Unfortunately, that's the best I can give for now. Hopefully, if it's not enough, someone else can provide an answer better suited to your situation. –  RHSeeger Jun 8 '11 at 15:24
add comment

I was in a very similiar situation not long ago. Here's roughly what in retrospective, I found the most useful approach to quickly learn the basics of a new technology:

General approach:

  1. Find out what problem it solves. Read various resources like the project's homepage, the wikipedia article.
  2. Find a small project that contains said problem. E.g. in your case, a small webapp managing your DVD collection with the possiblity to lend them to friends.
  3. Start to think about what mechanisms you would expect to be provided by the technology. E.g. for an ORM solution, a mechanism to specify whether a relation is 1:n or n:n.
  4. Search for these mechanisms in your technology: E.g. in JPA, find the @OneToMany annotation. Often, this is where you work yourself through a Getting Started Guide or the senior developer's code.
  5. Implement your mini-project using these mechanisms. While doing so, you will discover the limitations and probably a few other features. E.g. in JPA, the N+1 selects problem or a feature allowing you to automatically drop & (re)create tables for your Java classes.
  6. (If you can afford the time): Try to understand how you would implement the mechanisms. Doing so can help you understand why certain limitations exist and how you can work around them.

One note about Getting Started Guides: Don't read them before step 4. If you still do, this will bite you if you are learning very powerful frameworks like Spring with all its fancy features. As always in life, the more powerful your tool is, the easier you can screw up if you don't truly understand it.

share|improve this answer
add comment

I recommend Head First Servlets and JSP. It's a great resource for learning about Enterprise Java.

This book was written for developers interested in passing the Sun Certified Web Component Developer (SCWCD) exam. Sun has since been acquired by Oracle and this exam has been replaced. More information can be found here.

share|improve this answer
    
Aren't JSPs obsolete yet? They are pretty useless for "Web 2.0" applications that make heavy use of AJAX. –  kevin cline Jun 9 '11 at 5:11
add comment

The online Hibernate documentation is quite good. You could start there.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.