views:

180

answers:

6

Ok... so here's my actual status:

Been a PHP Scripter for way too long, I think I cover the basis, Good practices (structure, commenting, indenting, workplan, etc), OOP, MVC, security and a fair knowledge of PL/SQL. But never seen a single line of java code and it's time to do some kind of voodoo to "learn XYZ in 21 seconds". The goal is to write a full and complex application (I'm working for a global company) over MVC with lots of different patterns, also use of ORM, cache and persistence.

That's why I want to know which books to read for learning THE THEORY of Java then Spring and later Hibernate. Then the practice and endless debugging hours will give me more knowledge as with any other thing I've learned so far.

Any help (not jokes about being a PHPer) would be HIGHLY appreciated.

In short I want to know how to design a scalable web application with Java using (JBoss?) Spring+Hibernate

Also I don't want to star flames about what's best/worst and differences, just a few ISBN #s or links that point me in the right direction for learning... I have time, I just don't have any knowledge of where to start.

TIA!

Edit:

Ok, first at all thanks for the answers. Second I think I wasn't clear, I don't want to learn in 21 seconds (that was just reference for those "lear XYZ in 21 days"), I know is a lenghty process. I started programming back in 1998 with basic and pascal, then I learned C++, then came HTML/Javascript and PHP since 2003 I write only in PHP. That's why I want to move on maybe 1.5/2 years to Java and in here is Spring and Hibernate are the norm, so I was thinking:

1) Try XXXX to learn how CORRECTLY set up YYYY to start running Java 2) Read AAAA, BBBB, CCCC to embrace Java 3) XXXX, YYYY and ZZZZ are good for spring 4) Maybe AAAA, BBBB and CCCC could help in Hibernate

Also I know that I have to stay in front of you monitor like 8..12 hour daily PRACTICING and you'll be able to say "Hello world" in "n" langs pulled from the database abstracted in an object in the view called from a template in memory stored by the front controller using a couple of extended models.

And one more thing, I ask this because I love to program... it gives back a lot. I'm not a professional and I have the luck to earn some money and work with real professionals, but they are jealous of me because I'm an administrative guy who earns a couple of bucks in his extra time. That's why I'm asking in here and not to them.

Thanks again.

+1  A: 

Grails will take a lot of the pain of traditional JEE development away. It uses Spring/Hibernate under the covers, so you are using those techs, and it will generate wars for you; you don't have to write build scripts for a lot of tasks.

hvgotcodes
+7  A: 

"learn XYZ in 21 seconds"

Better read this.

You might be trying to bite off more than you can chew here.

You need Java - that's fundamental.

But you can go a long way with just servlets, JSPs written using JSTL, and JDBC.

You don't need Spring right away, but it will help you structure your apps in a good way. I would recommend Spring as an excellent example of well-designed, well-implemented, well-tested code looks like.

Hibernate should be at the end of the line. You may not need or want dynamically generated SQL.

I agree with the Grails recommendation because it'll ease your entry, but if anything goes wrong you'll be dead in the water. Grails is based on Java, Spring, Hibernate, and Groovy. If you don't know anything about its underpinnings you'll be at its mercy if it fails.

UPDATE:

Since you've provided more information, I'll add another thought.

The goal is to write a full and complex application (I'm working for a global company) over MVC with lots of different patterns, also use of ORM, cache and persistence.

Now that we've established that this is a long process, you need to make sure that the global company you'll (hopefully) be invoicing for this work is ready to support it. Do they have the infrastructure, the staff, the knowledge to follow you down this Java EE path? If not, you won't be doing them a service. Prepare them for what you have planned at the same time that you're preparing yourself.

Good luck. Maybe we can help you climb that mountain.

duffymo
yes to all of this, most importantly that most people cant go from PHP to JEE in a short amount of time.
hvgotcodes
Let alont from PHP to Java. Awesome answer btw, duffy :) Truth is hard.
BalusC
Thank you, BalusC. I appreciate that coming from you.
duffymo
Thank you very much for the honest piece of text. For now (hopefully for a long term) I'm working as outsourcing for GE, as I said there are several standards on such big company. I really don't know what will be doing in a distant future, but hopefully can achieve something as big in Java as I'm doing right now in PHP. After all I want to learn, I know the quirks but that has never stopped me before. One "hello world" at a time and I know in top 2 years I'll be moving from PHP to Java and trying to learn something new to reflect what technology is about: EVOLVE
Jhon Doe
I second @BalusC's comment, nice answer (+1).
Pascal Thivent
Thank you, Pascal. I have such great respect for both of you. Your kind words mean a lot to me. Sincerely, Duffy
duffymo
A: 

Well, http://www.oracle.com/technetwork/java/index.html is the basic point to start, then install Maven and use the generator at http://www.jweekend.com/dev/LegUp to generate some commands which, when run, will cause Maven to generate example projects. I'd sugggest the Wicket/Spring/JPA one (as JPA will be wrapping Hibernate) as a suitable starter 'all-in-one' project.

Gwyn Evans
-1 just for Maven. Any why wrap Hibernate when you've never done JDBC? Wicket when you have Spring web MVC? Sorry, I disagree.
duffymo
+1 just for maven - phenomenal building and packaging tool.
aperkins
+1  A: 

Java will take a little time, but one of the reasons Java is so popular is that the language is easy to learn. The framework APIs take a little longer. That being said once you are somewhat happy with doing Java. You should jump into Spring MVC to learn web development. Spring MVC is very easy to pick up IMHO, and the concept of Spring is so deceptively simple that I think newbies can learn it without a lot of back story. Plus using Spring gives you the ability to use Spring JDBC templates which makes JDBC a snap. And they are easier to learn than any ORM mapping tool. With your background in SQL/PHP this will be the most natural way of working for you.

Hibernate takes months to get productive at a professional level. It's frustrating, there's a high learning curve, and you'll just get frustrated because it forces you to do things a particular way that can be unnatural to someone familiar with SQL. I would not recommend someone start there. You will quit Java trying to learn it. And really you don't need it.

Grails sits on top of Hibernate so using it will force you to deal with it, and I think it'd be unrealistic for you to expect Grails to "just take care of" hibernate. I know some people love it, but mostly I hear that from seasoned developers with history of Java not newbies.

I wish you luck with your new venture.

chubbard
A: 

I would echo what everyone else has said here - learn Java first, learn the basics. Walk before you run, etc.

Joshua Bloch's Effective Java is a good book to start with to learn about some of the common behavior in Java. If you learn best from a conversational style book, the HeadFirst series has been really good when I have been teaching others about Java.

As for Hibernate, when you are ready for it, if you decide to use it I would recommend the Java Persistence With Hibernate book by Bauer and King (two of the Hibernate developers). Large portions of it are also available online.

I would also recommend learning about packaging and deployment. I personally prefer Maven as a packaging and building tool, although others prefer Ant. You will save yourself some hassle if you look into those once you are ready to start working on a larger project.

Also, to echo what @duffymo said, you may be biting off more than you can chew. There are a lot of moving parts in what you are describing, and having an experienced developer in the technologies (at the very least in Java and JPA/J2EE) would help the project go much smoother in the long run.

Good luck!

aperkins
Thanks for the titles, I'll look forward. Also thanks for the advices.
Jhon Doe
@Jhon sorry if people sounded overly ... pessimistic. Most of the time, I have seen people with similarly worded proposals/questions/etc being in the position of biting off more than they can chew. I have done it myself, personally. I would also recommend the Head First design patterns book - it really helps sink home the design pattern mentality.
aperkins
I know a lot (not everyone) of the most experienced people in high level languages tend to diminish (specially) PHP, but... hey! its scripting and too easy that someone like me can do it, also I'm not a pro and I work with pros. I would love a little respect, but they earned so hard his degree and feel threatened because I can do some code that no one can point and say "hey that's not OOP/safe/functional/tested/speed-wise/etc". I know that if I want to do something I have to do it nearly perfect, because I'm under the spotlight. So I knew this question got his sharp side. But thanks x1000
Jhon Doe
@Jhon Not diminishing any language at all. I have done work in Perl, Java, C/C++, Objective C, and a little PhP. The type of question, before your addition, sounded like someone who was really excited (Which I am sure you are) and who was maybe not entirely aware of the amount of time involved. I see that you are now, and good luck.
aperkins
A: 

Hi,

I am somebody who went to PHP from Java and J2EE and I love both the languages. Both have their own strengths.

Since you already are a programmer and are aware of fundamental programming concepts I will say invest some time with the official Java tutorial and you will learn a lot of Java in very less time. And many of the tutorials are written by experienced programmers like Joshua Bloch.

Core Java

To learn Core Java: http://download.oracle.com/javase/tutorial/java/index.html

Essential Java Classes: http://download.oracle.com/javase/tutorial/essential/index.html

Collections: http://download.oracle.com/javase/tutorial/collections/index.html

JDBC Database Access: http://download.oracle.com/javase/tutorial/jdbc/index.html

On J2EE:

I would suggest start with setting up tomcat and learn Servlets and JSP first then move on to Spring and Hibernate.

For Servlets and JSP:

Head First Servlets and JSP. Though this one is more geared towards SCWCD exam.

Spring and Hibernate:

I kind of learned from here and there. But haven't really coded in it since last 2 years so quite a few things must have changed. Back then we wrote so much XML for Spring that it felt like I was coding in XML rather than Java. :) I hear with annotations a lot of things have changed.

Also investing time to use either Eclipse or Netbeans will be really helpful.

I hope that helps.

Pritam.

Pritam Barhate