What is the best way to learn Java and start follo

2020-08-09 04:41发布

问题:

I would like to build some sites using Java stacks but would like to follow some blogs/books/articles coming from a ASP.NET background. Would need to know about tools, productivity tools, that are used to developer Java apps.

回答1:

You will want to look into Struts2 as a web framework. If you're not familiar with doing web development using an MVC framework there will be a bit of a learning curve.

If memory serves correctly Tapestry is the closest you'll get to the ASP.NET event based model in the Java world (someone please correct this if I'm wrong).

You will also want to look into Maven. I don't think there's anything that has quite the same kind of functionality in the .NET world. When I used it on a project, it was for dependency management if you plan to use (and you most likely will) external libraries. Someone much smarter than me set it up for me when I needed it so I have no idea how steep the learning curve on it actually is.

If you're not familiar with Dependency Injection and Inversion of Control patterns, you should become familiar with them. If memory servers correctly they are used fairly pervasively on the Java side.

Eclipse is a great IDE, it requires a bit of cuddling to get it to put out, but once it does it can be quite nice.

You might also be interested in reading this blog post by another mostly .NET developer trying to gain some Java experience.

Last but not least, you will really miss Linq.



回答2:

I think it's a fair question.

If you're interested in Java web apps, the easiest way to start is to look at the following:

  1. You need a JDK - download one from Sun/Oracle. JDK 6 is the current version.
  2. A servlet/JSP engine - Tomcat from Apache is a good one that's free. Look for version 6.x
  3. Servlets are HTTP listeners.
  4. JSPs are templates that are compiled into servlets. You'll want to write them using JSTL (Java Standard Tag Library). Apache has a fine implementation.
  5. You'll connect to relational databases and execute SQL using JDBC.

You can go a very long way with these technologies.

You'll want an IDE. Eclipse and NetBeans are both free, but I think IntelliJ is the best, hands down.



回答3:

When I was looking into C# from a JAVA perspective, I came across this:

http://www.25hoursaday.com/CsharpVsJava.html

Perhaps it will be somewhat useful for you going the other direction.