Java Platform, Enterprise Edition (Java EE)
The Java Platform, Enterprise Edition (Java EE) is a collection of Java APIs owned by Oracle that software developers can use to write server-side applications. It was formerly known as Java 2 Platform, Enterprise Edition, or J2EE.
Sun Microsystems (together with industry partners such as IBM) originally designed Java EE to simplify application development in a thin-client-tiered environment. Java EE simplifies app development and decreases the need for programming by creating standardized, reusable modular components and by enabling the tier to handle many aspects of programming automatically.
Java EE applications are hosted on application servers, such as IBM's WebSphere, Oracle's GlassFish or Red Hat's WildFly server, all of which run either in the cloud or within a corporate data center. While Java EE apps are hosted on the server side, examples of Java EE clients include an internet of things (IoT) device, smartphone, RESTful web service, standard web-based application, WebSocket or even microservices running in a Docker container.
Java EE architecture goals
The Java EE architecture provides services that simplify the most common challenges facing developers when building modern applications, in many cases through APIs, thus making it easier to use popular design patterns and industry-accepted best practices.
For example, one common challenge enterprise developers face is how to handle requests coming in from web-based clients. To simplify this challenge, Java EE provides the Servlet and JavaServer Pages (JSP) APIs, which provide methods for activities like finding out what a user typed into a text field in an online form or storing a cookie on a user's browser.
Another common task is how to store and retrieve information in a database. To address this goal, Java EE provides the Java Persistence API (JPA,) which makes it easy to map data used within a program to information stored in the tables and rows of a database. Also, creating web services or highly scalable logic components is simplified through the use of the Enterprise JavaBeans (EJB) specification. All of these APIs are well tested, relatively easy for Java developers to learn and can greatly simplify some of the hardest parts of enterprise development.
Java EE core technologies
Along with the four aforementioned APIs, there are more than 30 Java APIs included as Java EE core technologies, with that number to approach 50 with the eventual release of Java EE 8. These Java EE core technologies broadly fall into the following file categories:
- HTTP client technologies. For dealing with HTTP-based clients, Java EE includes the Java API for WebSocket programming, an API for JSON Processing, the JSF and Servlet APIs and the JSP Standard Tag Library (JSTL).
- Database and resource access technologies. For interacting with external and back-end systems, Java EE includes JavaMail, a standard connector architecture, a Java Message Service (JMS) API and a Java Transaction API (JTA) for enforcing two-phase commits.
- REST and web service technologies: To help with the development and deployment of REST-, SOAP-, XML- and JSON-based web services, the Java APIs for RESTful Web Services (JAX-RS) and XML-based web services (JAX-WS) are included, along with APIs for XML messaging and XML registries (JAXR).
- Java EE security and container management: For implementing custom Java EE security and managing Java EE containers, software developers have access to the Java Authorization Contract for Containers and the Java Authentication Service Provider Interface for Containers.
Java EE vs. Java SE
The APIs listed above are just a sampling of the various Java EE components available to developers. All of the APIs defined in the Java Standard Edition, or Java SE, are also offered to Java EE applications.
Java EE does not compete with Java SE, but is instead a superset of APIs that builds upon the foundation provided by Java SE and the standard Java Development Kit (JDK).
Java EE applications build upon the foundation provided by Java SE, and all Java EE applications run on a Java virtual machine that supports all of the APIs defined by Java SE.
Developing and deploying Java EE applications
The server-side application development process in Java involves:
- Writing code that utilizes Java EE core technologies
- Compiling that code into bytecode
- Packaging that bytecode and any associated resources into an Enterprise Archive (EAR) file
- Deploying the EAR to an application server
This process could be accomplished simply using nothing but a text editor and the Java compiler that comes standard with an installation of the JDK. However, there is a rich ecosystem of integrated development environment (IDE) tools that assist in the rapid application development of Java EE code.
In terms of open source IDEs, the Eclipse IDE and Oracle's NetBeans IDE are two of the most popular for Java EE development. Both provide source code formatting, syntax checking and project organization, and they also have a rich plug-in community, allowing users to create components that will add extra functionality to the IDE.
Plug-ins are commonly required to build, deploy and perform continuous integration to Java EE applications. In this space, plug-ins for build projects like Maven, deployment tools like Gradle and continuous integration technologies, such as Jenkins and Hudson, are popular.
Java EE vs. Spring Framework
A standard for enterprise Java was first established with the release of the J2EE specification in December of 1999. This first foray into establishing a baseline of support for server-side compliance defined less than a dozen APIs, with the focus being on front-end development with Servlets and JSPs and back-end development being done with EJBs.
There were incremental improvements with the release of J2EE 1.3 in September 2001, with the addition of the JSTL being one of the release's most significant accomplishments. The inclusion of the HTML framework JSF was a further highlight in the release of J2EE 1.4 in November 2003.
Many people in the development community derided the J2EE approach to enterprise software development as being too academic, too cumbersome and heavy. As an alternative to J2EE development, with a significant focus on eliminating the use of J2EE's EJBs, programmer Rod Johnson created the Spring Framework. Working independently of Sun Microsystems, which was the steward of the J2EE framework at the time, Spring proved that enterprise-grade applications could be written in Java without needing the entire J2EE stack.
The Spring Framework took a more lightweight approach to the Java-based development of enterprise software, and developers began to embrace this simpler approach to application design.
Java EE 5 and lightweight EJB development
Recognizing the rising level of dissatisfaction with traditional EJBs, a new lightweight approach was introduced, with the new EJB 3.0 specification becoming part of the May 2006 rebranding of J2EE to Java EE.
Being released at a time when the current JDK was on its fifth version, the newly branded enterprise Java specification was named Java EE 5. Other major additions with Java EE 5 included the JPA and JAX-WS.
Java EE 6 and RESTful web services
While Java EE 5 provided API support for SOAP- and XML-based web services, the December 2009 release of Java EE 6 introduced support for REST by including the Java API for RESTful Web Services (JAX-RS).
The other big change in Java EE 6 was the introduction of a web profile. This feature allowed vendors to create Java-EE-6-compliant servers that provided only a subset of the overall Java EE functionality. These profiles, which are essentially scaled down software stacks, reduced the distribution size of a Java EE application, making it easier to deploy apps to devices with limited computing capacity.
This new approach opened opportunities to use Java EE for IoT devices and embedded software. For example, the Java EE 6 Web Profile required Servlet and JSP support, but did not require support for APIs like JavaMail or the Java Authentication Service Provider Interface for Containers (JASPIC).
Java EE 7 and WebSockets
Released in June 2013, Java EE 7 took advantage of the emergence of HTML5 and the need for Java EE web browser support.
The Java API for WebSocket development was introduced, as was the Java API for JSON Processing, making it easier to send information formatted in JavaScript Object Notation (JSON) back and forth from the client to the server.
Java EE 8, containers and cloud computing
Scheduled for release in late 2017, the Java Community Process (JCP) has stated the main focus on the latest Java EE release will be about "support for HTML5 and the emerging HTTP 2.0 standard; enhanced simplification and managed bean integration; and improved infrastructure for applications running in the cloud."
Expect New APIs in Java EE 8, including JCache, the Java API for JSON Binding and a new framework for web development named Model-View-Controller. Furthermore, many existing APIs will undergo updates, including the Java API for WebSocket, JSF, the Batch Applications API and JPA.