Java Technologies to Use in Projects
A wide variety of Java technologies exist which can assist the development of complex and intricate applications. By learning to apply these technologies, we can spend more time developing the unique and interesting portion of our applications and less time reimplementing the wheel.
Projects may be developed with any sufficiently innovative application in mind, including but not limited to:
- Enterprise Java web application development, using a technology stack based on a Java application server such as JBoss
- Real-time programming
- Multimedia programming using the Java Media Framework API
- Desktop application development with Swing
- Graphics manipulation or analysis software (using Swing or Java3D)
- Mobile software development with J2ME
Web Application Development
It is recommended, especially for those without significant experience one of these areas, to base your project on the J2EE platform by developing a web-based application. The intent of enterprise Java is to develop an application which resembles a desktop application in its functionality and purpose but which can be delivered to the user through a web browser. This allows for fewer assumptions to be made about the client machine, permitting for more rapid development, simpler deployment, and fewer client-side resource demands.
J2EE applications are typically developed using three-tier architecture. The first tier, which provides functionality for rendering the application to the client (typically by using HTML and Javascript), may use any of the following technologies:
- Java ServerFaces (JSF), which allow a Java web application to be structured less like a webpage and more like a Swing application,
- Java Server Pages (JSP), the predecessor to JSF (and not recommended for use in your project),
- JSP Standard Tags Library (JSTL), a JSP-inspired technology which is still pertinent to JSF,
- RichFaces or MyFaces, JSF libraries which provide complex desktop-like functionality in a web browser (similar to JFC components in Swing),
- and many more.
The second tier of a J2EE application contains application-specific logic. This is where most of the innovative code actually lives and a lot of effort goes into accomplishing these tasks. However, fundamental chores such as wiring different sections of the application together without heavily coupling them have been extracted into common libraries such as:
- Servlets, which simplify the busywork of handling HTTP requests and responses (and, these days, are usually presented by other libraries as a wiring tool),
- eXtensible Markup Language (XML) technologies (tutorial), which are often used to communicate data between tiers of the same application or between different applications,
- Web Services standards (WSDL/SOAP/UDDI/...) for standardized communication with specific services using XML,
- The Spring Application Framework for Java EE, which provides a means by which the relationships between different portions of an application can be removed from the application code, reducing coupling,
- Seam, a technology similar to Spring in purpose but which loosens the wiring by using annotations instead of XML configuration files,
- AJAX, which is used as a communication mechanism between the first and second tiers in order to provide interactivity,
- Java Naming and Directory Interface (JNDI), which is handy for referencing resources which are made available by other applications or network resources and which should not be coupled to the application,
- and many more.
The third tier involves the persistence of data and interaction with a database. Technologies which facilitate this process include:
- The Java Database Connectivity (JDBC) API which, while no longer typically used directly by J2EE developers, provides the foundation for other technologies such as
- Object-relational mapping frameworks, which permit objects in Java to be serialized to a relational database by automating the mapping of references to relationships; an example of ORM is
- Hibernate, which is widely used for persistence of application data and more recently used indirectly by exercising the
- Java Persistence API (JPA), a generalized means of describing ORM in Java.
- Of course, there are others as well.
It is important to note that the above technologies are not exclusively related to the tiers mentioned above; several of them interface with multiple tiers (such as Seam or AJAX) and some can be used entirely outside of the context of J2EE development (such as Spring or Hibernate). However, the above organization is representative of how they are used and considered in enterprise development.
As a starting recommendation, a simple J2EE project could include a stack built out of the following technologies:
- The JBoss application server,
- Hibernate for persistence, configured through JPA,
- Seam for wiring and application logic management,
- and JSF and RichFaces for presentation and interactivity.
Other Java Technologies
These technologies may be useful in any project but are more likely to be applicable for non-J2EE applications:
- Java Native Interface (JNI) for including native code in a Java application,
- The Java reflection API, which allows dynamic analysis and manipulation of Java code and is used heavily in the above enterprise technologies,
- Java Security, providing numerous cryptographic algorithms and access controls,
- and numerous others.