Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am a .NET developer (and have been for a while now). I work for an organization that was just recently acquired by a larger company whose primary development language is Java. There are a few .NET developers, but the ratio of .NET to Java has decreased substantially now that the teams have merged.
That being said, I've decided it would be best for me to start Java development. However, most of the books I've seen so far for "learning Java" all take a very basic approach (what is a class, OOP principles, etc etc). I am comfortable with this part of development and don't need a primer (unless there are differences so profound that someone recommends the fundamentals from a Java perspective...).
Anyway, I'm looking for a book recommendation for Java development from a software developer's perspective that discusses today's techniques. For example, MVC architecture, application best practices (I am a web developer, this includes web services), is it worthwhile to work with JSPs or consider Ruby instead, etc etc.
A HUGE bonus would be "learning through doing". Something like Murachs, where I can step through a project from start to finish, and is light enough on fundamentals that I don't get bored. I'm hoping to walk away with enough basic knowledge to volunteer for some internal projects and grow from there.
I'm sorry if my question is needlessly broad, but I'm struggling to find a starting point aside from my Eclipse installation (I am doing this on Ubuntu, deliberately avoiding Windows).
Thanks for any direction or insight you can offer.
EDIT - After discussing with a co-worker, and reading Bert's great suggestion (all of them have been excellent, thank you all very much), it turns out the main focus is on EE, and Glassfish. They use NetBeans for development, since it is tightly bound to Glassfish.
This doesn't mean much to me, except that I think the parallel drawn is IIS/Web apps to Win32 apps. But perhaps it will help clarify some of the more open-ended questions in my OP.
Effective Java By Josh Bloch
It may not be "learning by doing" but it gets into the details of how to use the Java language effectively.
I would then complement it with Java Puzzlers by Josh Bloch and Neal Gafter
My best bet is to learn Spring based on your requirements:
MVC architecture, application best
practices (I am a web developer, this
includes web services), is it
worthwhile to work with JSPs or
consider Ruby instead, etc etc.
You can start by visiting SpringSource at http://www.springsource.org/
There are a few points I would like to make to you:
The basic Java language is rather small and C-ish. To my understanding C# and Java works almost identically here.
The Java runtime library is VERY, VERY BIG, and rather unlike C#. Very few people know all of the Java 6 runtime library well.
There are several IDE's in common use for Java. You will want to learn the one used by the rest of the team.
I would suggest having a brisk walk through the Oracle Java Tutorial, just to get the hang of the spirit and do some of the exercises, and then look at the common "Java for C# programmer" cheat sheets on the internet. Then do a lot of code, and then read Effective Java.
(For those who think they know Java 6 runtime well, please consider if you are familiar with RMI, the Rhino Javascript engine, and XPath in the XSLT implementation and all the rest)
Please look at the following thread:
https://stackoverflow.com/questions/75102/best-java-book-you-have-read-so-far
Ruby makes no sense unless you're writing JRuby on the JVM.
If you're writing web apps, you'll need to know JSPs written using JSTL (JSP standard tag library), servlets, HTML, CSS, and JavaScript. Download Tomcat from Apache - it's a servlet/JSP engine that will let you deploy web apps locally for learning. It has an HTTP listener built in, so you don't need IIS or Apache.
You'll need to know how to create and deploy a web archive (WAR) file. That's a ZIP file that contains the standard format for a web application.
I'd have a look at the Tomcat "first web app" docs to get a feel for it.
Once you have that, come back and talk about frameworks. (When you do, I'll recommend Spring.)
Here are some references I like. I'm sure there are better, but there are the ones I have read and can vouch for:
Java in a Nutshell is a classic summary of the core language. If you need more, there are books like Java for Programmers for programmers transitioning to Java (I have not read it).
Sun's Core Servlets and JavaServer Pages was a good book for Java servlets and JSPs. But consider that a lot of web tech is built on top of this (e.g. Spring), so this may be giving you foundation but not direct knowledge of the specific framework you will be using. Also a lot of web tech these days are client-side/JavaScript/AJAX-based, e.g. jQuery.
As for MVC, consider focusing on MVP instead. I been playing around with Google Web Toolkit to leverage my Java background to create client-side apps, but it is also a good way to get some idea of MVP - read Large scale application development and MVP Part I and Part II, and the GWT MVP Development with Activities and Places. However, GWT keeps evolving.
My last suggestion is that you narrow your focus - try to figure out what frameworks are popular at work and decide if you want to focus on a tier: front (e.g. HTML/CSS/jQuery), middle (e.g. Spring), or back-end (e.g. Hibernate). Once you figure this out, then post a more specific question(s) (e.g. what are the best resources for learning XYZ).
Just from my experiences with java (limited but I took a Web Dev course teaching JSP's) Any decent technology for it is usually 3rd party. However, from what I can tell when doing web dev I would use Netbeans, Netbeans has Tomcat built in especially in Ubuntu for easy debugging.
More on similar lines you can find answers from this post
https://stackoverflow.com/questions/3820437/life-after-head-first-java/3820449#3820449
The Java landscape is quite wide as you probably have already figured out.
There are hundreds of frameworks and tools that can be used for basically doing the same thing. To get an idea, you can take a look at this presentation written by Matt Raible, where he compares a number of Java web frameworks.
As someone else suggested, you should definitively take a look at the Spring Framework. It is widely used in the enterprise world. There are several good books about Spring.
If you want to get the basics of Spring MVC in a "tutorialized" style, you can take a look at this book. It doesn't cover the latest Spring version (3.0) and it is not a "perfect" book, but it should allow you to get the basics while running some examples.
Also, there are literally thousand of Spring-MVC tutorials on the web.
For instance, you can take a look at:
http://www.adobocode.com/spring/a-spring-web-mvc-tutorial
RESTful services are also quite popular these days. I have been working with the Resteasy framework from JBoss and I found it very easy to setup and work with. This book explains the REST architecture and uses Resteasy as framework for the examples.
I also recommended "Head First Design Patterns" from O'Reilly. It covers the most important patterns using Java and it will help you to see how the language can be used for patterns you may be already familiar with.
One more suggestion: you may considering "tuning in" on Java TV. It's a great resource with hundreds of Java tutorial videos. It covers a wide spectrum of technologies so you should be able to find something for you.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
As a developer going through web development I would like to know if J2EE or PHP is better for building web sites.
My initial thoughts were that J2EE was better because it is Java based but upon reading several articles I read that PHP might be easier and more focused with regard to web development.
On this topic I have another query, whilst looking at different articles on web design and construction I came across websites that claimed to be built in J2EE, Java and Ruby. Is J2EE the same as Java? Or is it something completely different.
First of all, there is no J2EE anymore. There is Java EE. One profile in Java EE is the web profile. So while Java EE has a bunch of complex, enterprise-level stuff in it, you just use the piece you need.
However, it isn't even like Java EE is the choice for developing web applications in Java. It is the standard, but people have enjoyed great success with open-source frameworks like Spring MVC. If you expand your scope beyond Java to all JVM languages, you have Grails (in Groovy) and Play (in Java but also in Scala) at your disposal as well. Both are extremely good.
And then there are so many other non-JVM options like Zend (PHP) as you say but also Rails, Django (Python), etc.
So to truly appreciate what's "better," you need to consider a lot of things:
Your comfort and productivity with the language
Your comfort and productivity with the "ecosystem"--i.e. accessing third-party libraries to help you with various tasks, ease of mocking and testing, boilerplate code and mundane tasks being abstracted away, ease of implementing caching and minifying web assets, etc.
Ability to find help online through a vibrant community
Your requirements. If you need to access Amazon S3 buckets, for example, and your language or third-parties libraries in that language have poor S3 support, you should avoid it. Similarly, if you need to use Neo4J as a data store but there is poor support, move on.
There is no "right" answer to this question. I would suggest the options approach described in Lean Software Development. Do some research to narrow your choices to three. Then get a site up and implement a representative feature with all three choices. The less appropriate choices for you will eliminate themselves and leave the best choice for you.
As for your last question, Java is a programming language; Java EE is an enterprise software platform utilizing the Java language and the JVM (with multiple profiles as mentioned). The Ruby part of the application you mentioned was probably utilized with JRuby, which enables you to run Ruby on the JVM via JSR 223.
this is depend on you skill or understability if you have good configuration knowledge then i suggest to you got through java j2ee. php is more easy to java
To be short and concise, If we're talking about professional development, then Java is the way to go.
If you're a hobbyist, then PHP would most probably be the right choice of yours.
I'm building a web application that needs high performance. I intended using Java EE but after researching about it, there are many negative comments about Java EE applications.
I'm thinking about the Lift framework, but it seems that Lift only support Scala, and I only know Java. Does Lift actually support Java? (I can't find any project example that uses Lift with java). I downloaded a Lift framework project application and there is a boot file in it, can we create a same boot file but for Java?
I'm pretty sure Lift is Scala only. If you're looking for high performance and Java then you should check out the Play Framework as it also has the benefit of not requiring a Servlet container to be deployed.
The Lift framework is Scala only. I want to note that in my experience the transition from Java to Scala was not that hard and now that I know it, there are many language features that make development easier and faster for me. You can take a look at this guide for transitioning between languages: http://www.scala-lang.org/node/960 to see if it might be something that might be right for you. From experience, I really enjoy using the Lift framework as it offers a lot of performance and functionality. The documentation is a bit lacking, but the community is great and makes up for that if you get stuck.
As for Java EE having negative comments, that is a bit vague. The Java EE spec includes everything from Servlets to JSF and EJB. Parts of the spec you will find in almost any web framework (including Lift) and others are more specialized. JSF for example has a lot of overhead, but tries to simplify a lot of the typical application lifecycle. EJB similarly tries to simplify the persistence layer through object relationship management (ORM).
High performance sites can be accomplished with most frameworks, but a lot of it will come down how you develop it. Also, because the framework supports it does not mean you need to use a particular component. Spring (http://www.springsource.org/) is a framework that many people have used on high performance sites, and is incredibly configurable (Supports EJB and JSF, but you don't need to use it). Also, Wicket (http://wicket.apache.org/) is a Java framework that offers a similar feel to Lift that might be interesting to you.
I worked with Lift only for a year now, and was never really interested if it would run from java (I wanted to learn new effective conceptions anyway).
So, I don't fully know the subject. But what I know for sure is that Liftweb has java methods almost everywhere to support java, too. So, you can build your app if not fully in java, then most part of it.
Prooflinks are like these:
http://main.scala-tools.org/mvnsites/liftweb-2.4-M4/net/liftweb/actor/LiftActorJ.html
Classes that add support for java by adding java-acceptable method names and such. These classes usually have a "J" letter at the end.
Anyway, I'd suggest to try out Scala, too -- it's great. And even if you use java only -- you probably will get used to Scala anyway, because you probably would want to read the source code sometimes.
I have worked with Django before and have recently seen the Play framework.
Is this the Java community's answer to Django? Any experiences with it? Any performance comparisons with other Java web frameworks?
Edit:Almost similar to this question, the responses, unfortunately don't say much about the framework.
Play! is a breath of fresh air into Java and bypasses all the Enterprise cruft that has evolved over the years. Even the namespace is just play not com.playframework. It is supposed to be an answer to Rails, Django etc and is MVC based. It is needed for Java to stay relevant in all but deep entrenched enterprise shops.
Play! reduces the overabstraction and painful configuration of old Java. It is a complete stack it does not rely or play to the old Servlet/EJB methodology like Restlet tried to do (making REST easier in Servlets). Play! is a great REST based Java framework that is a valid contender to other platforms MVC frameworks.
It is very RESTful and it is easy to bind a parameter to a java method. They have also made JPA much easier to use through their play namespace.
play.db.jpa.Model
public void messages(int page) {
User connectedUser = User.find("byEmail", connected());
List<Message> messages = Message.find(
"user = ? and read = false order by date desc",
connectedUser
).from(page * 10).fetch(10);
render(connectedUser, messages);
}
Python is used for scripting instead of builds with Maven which might save a few lives.
I haven't been this excited about a Java framework since Red5 or Restlet. A bonus is they have easy ways to get your app up on Google AppEngine as well using the Java version of GAE.
I have been using Play! now for a few months and in fact have come to love the framework. I struggled with Rails and Django a bit, mostly because I am really not a fan of dynamically-typed languages; however, there was never a really good web development framework for Java to compete with these. In terms of productivity, Rails and Django were the leaders for the MVC arms race that was going on. Play! is awesome, it's concise, scalable, powerful, and it has a great community that is growing all the time. If you're still really into using a language like a Python or Ruby, you can use Play! with Scala too. I am really trying to get into Scala right now because I think it has a great future and it's a lot of fun to use. Anyway, I would recommend giving it a try!
The Play! framework is a really good piece of software, and that the JavaEE bloated environment should be inspired from.
I moved from Java -> Django because of the fast cycle "modify file" / "reload browser", and the Play! framework makes me came back to my favorite Java language.
It could also be compared in some terms to what Grails and in general dynamic languages in Java (Groovy is used in Play!) are trying to import: simplicity, speed and reliability.
I am also a Django user. I've just visited the Play framework and skim thorugh its documentation. It has the simplistic design Django has been known of. It even has app engine support built-in. I'm sure many java developers will support it, and it only need some time to see cool plugins from the community.
We recently started using Play for building a webservice for various mobile applications. I come from a Java environment. I can tell you that the learning curve isn't all that steep--literally in an hour I had the webservice running with basic API already. One week later we were on Amazon Web Services. I definitely see a future for Play as it simplifies web development for Java developers.
Couple of things that I noticed however (asset versioning, etc.) still are not built into the framework, but i'm sure they'll be there in time. I would say it is definitely worth a shot using Play.
I come from a very strong java background. So my answer here could be a little biased.
Play finally brings to the java community what django has been for all these years in the python community, but just a way better.
Play is built on the jvm therefore inheritance all the goodies from a solid platform that has been proving over the years to be the most reliable and scalable one that allows to write and run applications at scale.
I want to say that I did try django. Its popularity among the web community made me curios and I wanted to give it a try.
Strangely I did not find it as easy to use as I had expected.
So many configurations. Too may libraries doing the same thing and often not play very well with each other. A way too much magic.
Furthermore, not having type safety makes very hard to manage and maintain
web application at big scale.
Don't get me wrong, I am pretty sure that people managed to do it, but in my experience I still find java/scala best suited for this, especially when you share the code base with a lot of other developers.
IDE support for Java it is unbeatable. If you implement TDD you will find yourself refactoring code and moving things around on the daily basis. And java IDEs give you all this power. With type safety and more.
My take away is that as long as you find yourself writing a simple CRUD application/prototype/toy without even thinking too much of advanced features and big scale then you can probably find some advantages on using python/django. Otherwise the whole java ecosystem wins hands down. And play is the cherry on top.
I've Inheritted a large Java Web project which I've got to make some modifications to, I'm a fairly competent Java Programmer when it comes the the basics but I've never done any JSP programming or EJB programming before. I remember vauguely doing some servlet programming 5 or so years ago in university, but I'm assuming that everything has changed since then.
I'd planned on getting myself up to speed this weekend, but I don't know where to start.
What would be a good learning trail to get me from Zero to proverbial Hero? or at least to a level of competency which will let me be able to read the JSP servlet and EJB code and understand how it works well enough to modify it and deploy it?
Ofcaurse it depends a lot on what project you inherited and when it was written.
Also what technologies are used?
The best resource on starting J2EE development I think it's the Java Passion site.
The online tutorial on netbeans.org are very good. I recommend to download the NetBeans 6.5 IDE (free) and walk through the J2EE tutorials.
The tutorials are very well written, and introduce the basic elements of enterprise and web development. They also require very little time to complete.
http://www.netbeans.org/kb/
Find out how complex it is. There is a vast difference between a web application without EJB's and one with.
Is it running in JBoss/Tomcat/Jetty/Resin/BEA/WebSphere?
I am a .NET Developer with about 5 years of web development experience using Microsoft technologies starting with classic ASP to ASP .NET 3.5.
I do have a little background in Java as well and can write/understand Java code very easily. I am looking for resources (online, books) that are compatible with my .NET experience. I am only interested in web development in Java and want to start at intermediate level even if it may require me to look up some details.
What path or resources would you recommend for intermediate .NET web developers to gain equivalent proficiency in Java web development tools?
Get an IDE: IntelliJ (my preference), Eclipse, Netbeans;
Get an application server: Glassfish (my preference; either v2 or v3 Prelude), JBoss or, if you're feeling adventurous, SpringSource dm server;
Get a JDK eg 6u11;
Get a copy of Spring 2.5.6 (or 3.0M2 if you're feeling adventurous);
Get a copy of the Spring reference documentation;
Put the pieces together.
Get yourself a copy of eclipse, and just start reading other people's code, and reading some java docs. The Java website has all the docs online, and they're one of the best language specs I've seen.
Really, if you know C# pretty well, Java should be a cake walk. The languages are pretty similar, so you just need to get to know the different frameworks.
Probably the most helpful book in regards to learning Java's web development framework, Java Server Faces:
Core JSF
- Great examples and explainations throughout on the whole process of using the JSF Framework.
And of course for anyone new to Java I would recommend:
Effective Java
- Covers various design patterns and practices.
In my experience that official Java exams are better than the .Net equivalents, so it may be worth starting there?
Search for a servlet/JSP tutorial (Good, albeit a little old, example here).
You'll get basic knowledge of Java web application development.
Whatever your level is, JSF for Nonbelievers is the best introduction to JSP/JSF.
I'd check out Bitter Java.
It's a book that shows you the wrong way to do things, why it's wrong, and then it shows you the right way.
It pretty much falls in line with the evolution of the j2ee framework. Started with servlets, then moved into jsps, then command pattern, etc.