How I can start developing in Java ?
Well, that’s not easy to answer. It depends on your knowledge, skills and objectives. In my case I want to run Java applications on an Application Server (AS). To do this it’s reasonable to think that you have basic skills in Java, that is, at least you can create a standalone Java application, if possible something more complex than a
Hello World application. And also is desirable to be able to structure minimally a program into a good package / class organization, not mixing concepts and not creating classes without a specific purpose.
Why an AS ?
This question is easier to answer. Nowadays where Internet is around the World there is no sense to develop that old-fashioned standalone applications. They basically are hard to distribute and maintain, and they are also too much platform-dependent (yes, even running on a VM). With an AS you deploy your application once. If your app is a Web-based application it runs almost completely on the server and the client has only an Internet browser as an interface to the application. If you want to run rich client interfaces (Swing, Java FX, ….) with some kind of connection to a server, an AS will help you in order to distribute that applications and maintain the connectivity.
And now … Java EE
Years ago, people and organizations who create the specifications of Java language, created the Java EE specifications of what should be an enterprise Java Server. The best way to define a Java EE is to quote the Wikipedia entry about it:
The platform provides an API and runtime environment for developing and running enterprise software, including network and web services, and other large-scale, multi-tiered, scalable, reliable, and secure network applications. Java EE extends the Java Platform, Standard Edition (Java SE), providing an API for object-relational mapping, distributed and multi-tier architectures, and web services. The platform incorporates a design based largely on modular components running on an application server.
Some enterprises/organizations have developed AS based on Java EE specs. Here you can find a list of them.
Glassfish ? What the hell is that ?
When I started to understand the difference between Java (SE) and Java EE I began to investigate which AS was better for our needs at company. The ones investigated were:
- Websphere: at work we were using Websphere to run the interface for our ERP, but it’s a proprietary platform and a heavy-weight AS.
- Apache Tomcat: was the second one being investigated. We started at work development in a Tomcat server, and created two Web applications (not fully Java EE) that were running well on it, but during the development I found that Tomcat is only a Servlet Container and not really a Java EE AS. The good point of Tomcat was that it’s really simple, smart and lightweight. For very simple applications is a good solution, but in my opinion not good enough if you want to create a complex or medium-sized application. Finally I migrated the two applications to Glassfish but we still use Tomcat to add new functionalities to that two applications.
- JBoss server: this was the third one in competition. JBoss is fully Java EE 6 compliant nowadays (starting from version 7), but not when I investigated it 2 years ago. On that time I found that was too much slow to start / stop compared to Tomcat and Glassfish and that is a key point if you need to do continuous deployments. It seems that new version has an improved speed, but by now I didn’t give it a chance again.
- Glassfish: I found this AS an intermediate solution between Tomcat (fast, lightweight but not a Java EE AS) and JBoss (slower startup, and not a full Java EE at the time I was doing the investigation).
There are other AS around, like Weblogic, Resin, Coldfusion, Geronimo, but finally Glassfish was the option chosen, and by now I still maintain it (although not everything in Glassfish deevelopment is so wonderful).
At the moment I write this article the latest version of Glassfish is 126.96.36.199. Next article will have a little tutorial on how to install it.
Cardedeu, July 21, 2012