开发者

Beginning Java web development for experienced PHP web developers?

Feedback on a question I asked earlier has me wondering if there exists such a document or book as the one alluded to in this question title. I have searched the web in general, and previous StackOverflow questions (maybe I missed the right one?), but I have not been able to find what I am looking for.

I have several years experience with web development using PHP. My PHP work is mostly procedural, but I do use objects when appropriate. I like the PHP environment; that is, I like not having to compile and deploy for code changes to take effect. I like being able to use the same language for business logic and presentation logic. I like the ease of finding decent documentation for PHP. And I like how simple it is to setup an execution environment for PHP scripts (e.g. mod_php).

However, I am in the position of administering, and doing almost all of the in-house development for, a Java web application (a portal) being served with Apache Tomcat. Coming from the background described, I have been applying my "PHP way" of thinking to the Java work I have to do. Which basically means I forget about figuring out how to setup a development environment and just stick JSP scripts in the web root and avoiding writing full classes.

So, to list the things I am looking for in such a book:

  • Differences in terminology (e.g. why a web server is called a "container")
  • Differences in operating environment
  • Comparison of language best practices

I am not looking for "Java is object oriented and PHP isn't." I understand that the languages are different. I also don't want the silline开发者_高级运维ss that is Head First Servlets & JSP (a book my office has lying around).


I would highly recommend you to start with java helped on a framework like Spring. This will allow you to put away almost all the initial web java developer headaches and give and much better learning progression. Once you get managed with Spring Framework (of course use version 3.X) you should only worry about learning a bit of JSTL to give all the functionality you had on the presentation layer. If you mix all this with a good javascript framework like jQuery you'll get on the road much sooner than you think. 1) Learn a bit of JSP directives. 2) Take a look at JSTL. 3) Learn Spring 3 (MVC) 4) Learn JSTL in a deeper way.


To be honest, and i don't have a whole lot of experience developing on Java application servers, but i think you would do better just using a pure Java book (college/uni level), learning object oriented principles(inheritance, polymorphism, encapsulation) and java's OO constructs if that is not your strong suit. During the process you'll be able to compare and contrast the features to php you've already seen. The reason i say this is because the java API's are constructed using these things very heavily (abstract classes, packages, inheritance etc.) and you'll have to work with them, not against them to get anything done in terms of plumbing. In my experience, comparative books don't work, because it comes from the mindset that the two languages just have differing terminology, but are fundamentally the same in some way. This is misleading, because java ee has a lot more underlying building blocks that you have to be aware of before you jump in and start writing code for HTTP requests.

I would look at the official documentation for your preferred server, and for the java ee background reading I would stick to oracle's documentation, as it avoids misinterpretation of definitions.

just out of curiosity, is there a particular reason you have not moved toward a more object oriented approach of PHP before moving to the monstrosity of java ee?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜