Most developers have already heard of the Java 2 Enterprise Edition (J2EE) platform. And you can expect to hear more about it over the coming months, as well as this year's JavaOne conference. More and more vendors and developers will soon be jumping on the J2EE bandwagon, announcing new tools designed for enterprise development and new systems created using the J2EE. The question, for those who have read the hype but not the specifications, is: "What is the Java 2 Enterprise Edition?"
To answer that, let's start with the plain vanilla Java we've all come to know and love. When the Java 2 Standard Edition (J2SE) platform was released, it completely changed the programming landscape, by introducing new technologies (like CORBA and Swing) as standard features of any Java 2 JVM. This gives developers confidence, when designing systems using these technologies, that a suitable implementation will be available on the machines of users who run Java 2. The Java 2 Standard Edition is fantastic for developing applets, applications, and network services but it was designed for the consumer and small-business end of the market.
Java is a great language, don't get me wrong, but it wasn't initially designed with large-scale enterprise development in mind.
Until recently, there was no corresponding platform for building large-scale business systems. Most of the technologies that enterprise programming requires, like Java Servlets, Java Server Pages (JSP), Enterprise Java Beans, and XML were extensions to Java. As such they required separate installations and integration with third-party JVMs. The release of the J2EE platform rectifies this by providing a stable platform upon which business and enterprise developers can rely.
Changing the Landscape of Enterprise Development
When developing large-scale business systems for the enterprise, comprising dozens or even hundreds of smaller components, developers need access to a wide range of technologies for business tasks like transactions, messaging, databases, mail, and server-side processing. One of the problems with the J2SE platform was that you couldn't rely on all of these technologies being available. Java is a great language, don't get me wrong, but it wasn't initially designed with large-scale enterprise development in mind.
Sun Microsystems saw the need for an enterprise version of Java, for developing and deploying mission-critical business systems that interacted with each other, and with legacy systems using a variety of technologies like CORBA, XML, database and directory services. J2EE finally gives large-scale enterprise developers a Java platform for building such systems, and the guarantee of stability of features across J2EE implementations that is offered to developers by the J2SE platform.
While a J2EE SDK is available for testing and development, it is licensed on the proviso that it is not used in commercial production systems. Instead, an appropriate J2EE is licensed from a vendor who implements it for a particular hardware/software combination. However, a compatibility test suite guarantees stability between vendor implementations, and the J2EE SDK allows developers to test their systems in addition to a vendor implementation.
Tools and Technologies for Enterprise Programming
The J2EE platform runs on top of the standard Java 2 platform and covers ten critical technologies for enterprise development. Not every technology is appropriate in every situation, but when combined together, they make a powerful combination for creating high-quality, robust, and scalable systems:
- Enterprise JavaBeans (EJBs)
- Common Object Request Broker Architecture (CORBA)
- Java Servlets 2.1
- Java Server Pages 1.1 (JSP)
- Java Message Service (JMS)
- Java Transaction API (JTA)
- JavaMail 1.1
- Java Database Connectivity 2.0 (JDBC)
- Java Naming and Directory Interface 1.2 (JNDI)
- eXtensible Markup Language (XML)
Enterprise JavaBeans are the heart of a J2EE system. EJB is a component architecture for server-side development. Think of them as non-visual JavaBean components which contain the business logic of a system. Rather than putting your user interface and server-side application code together, you can create EJB components that are invoked by other systems, thus maintaining the separation between presentation and data-processing.
The Common Object Request Broker Architecture (CORBA) may be familiar to readers from the Java 2 Standard Edition. While CORBA systems can be written in J2SE, the introduction of RMI-IIOP (a bridge between Remote Method Invocation and the Internet Inter-ORB Protocol, which allows developers to create objects in Java without learning too much about CORBA's Interface Definition Language) makes CORBA an attractive choice for enterprise development.
Java Servlets and Java Server Pages (JSPs) have also been around for some time now. Nonetheless, it is an important topic, as either of these technologies can provide a Web-based interface to business systems and EJBs. Personally, I prefer servlets, but JSPs are gaining in popularity, and make it easy to write server-side code from within a Web page, in a similar fashion to the Active Server Pages (ASP) of Microsoft Internet Information Server. Either approach is an excellent way to offer Web interfaces, and they are far simpler for a Java developer than other technologies like CGI scripts.
Messaging and transactions are important for enterprise systems and are represented by the Java Messaging System and Java Transaction API. The Messaging System allows exchange of information and business data throughout the enterprise, while the Transaction API gives developers control over transactions, as well as the ability to commit or rollback a transaction (in the same way changes to a database may be committed or rolled back). Both will be welcomed by developers, along with the JavaMail API which comes as standard with the J2EE platform and gives access to message stores like e-mail and newsgroups, as well as the ability to send messages.
Databases, of course, form an important part of any enterprise application. Strong database performance and support is offered with Java Database Connectivity (JDBC) 2.0, a revised version of JDBC that improves control over how queries are acted upon (such as specifying whether pre-fetching should be used and grouping queries into batches).
The next big change is that support for the Java Naming and Directory Interface (JNDI) 1.2 is included with J2EE, allowing components to locate each other even if they are moved around the network. JNDI has been improved from previous releases to include enhanced LDAP support and event notification. Like many other technologies in the J2EE, it can be downloaded and incorporated into the J2SE but comes as standard with the J2EE.
With the Java 2 Enterprise Edition, the business case for Java is made even stronger.
Finally, there's the eXtensible Markup Language (XML), which has been one of the hottest topics in computing circles for the past few years. XML is being used from everything to exchange of information between databases, to shopping bots, to object serialization and messaging. XML support doesn't yet come as a standard part of the Java 2 Enterprise Edition, but its importance to developers ensures that it will be there soon! It is anticipated that XML support will become standard in a future version of the J2EE specification and will be quickly adopted by developers.
Playing with the J2EE SDK
The software development kit (SDK) for the J2EE is freely available for download, and is a good starting point. There's also a set of blueprints, which describe in more detail each of the various technologies of J2EE, how they fit together, and some coding guidelines that show "best practices" for Java enterprise development. Both the SDK and blueprints are available from the Sun Microsystems' Java 2 Enterprise Edition site. At the moment, the SDK is available for Windows NT and Solaris systems, but expect application server implementations for other platforms very quickly.
The Java 2 Enterprise Edition is an entire platform for designing large-scale business systems, and is composed of a huge range of different Java technologies. Together, they blend into a single standard for enterprise development, one that is being adopted by a large number of Java tool and server vendors. Some of these technologies are also available for the Java 2 Standard Edition platform and will already be familiar to readers, while others are completely new.
Combining all of these extensions into a single unified platform makes good sense, and with the Java 2 Enterprise Edition, the business case for Java is made even stronger. The Java 2 Enterprise Edition is set to be a hot topic, as more and more businesses discover the potential it offers. With Sun positioning Java as a platform for constructing and deploying enterprise systems, expect to see many announcements from vendors about enterprise products this year.
About the Author
David Reilly is a software engineer and freelance technical writer living in Australia. A Sun Certified Java 1.1 Programmer, his research interests include the Java programming language, networking & distributed systems, and software agents. He can be reached via e-mail at email@example.com or his personal Web site.