The Evolution of Java EE
The Evolution of Java EE
Java began life as a programming language designed for building stand-alone applications and grew rapidly into
other spheres. A large part of Java’s popularity can be attributed to its usage in creating web applications.
A web application consists of static and dynamic (interactive) web pages. Static web pages contain various types
of markup languages (HTML, XHTML, and so on) and are used, in general, to provide information; dynamic
web pages, on the other hand, are capable of generating content with the aid of additional web components.
Thus, a web application is a collection of web pages and is capable of generating dynamic content in response to
requests. Unlike a web page used merely to provide information, a web application lets you perform some activity
and save the result. Developing a web application, however, is fundamentally different from building stand-alone
applications and requires you to understand the following three key elements:
The Java EE platform: This is the set of API specifications that are the building blocks of the web
application.
The web container: The web container implements the API specifications of the Java EE platform.
Specifically, the web container provides the services for managing and executing web components such
as servlets, JSPs, filters, listeners, and render responses to the client.
Web components: These are hosted by the container. These web components, such as servlets, JSPs,
filters, and listeners.
The Java EE platform is aimed at standardizing and reducing the complexity of enterprise application
development by providing an application model that defines an architecture for implementing services as
1
multitiered applications. In a multitiered application, the functionality of the application is separated into distinct
functional areas, called tiers. Figure 2 illustrates the typical multitiered architecture in a Java EE application
model.
As shown in Figure 1, a new Web Profile specification was first added in Java EE 7. As mentioned earlier, the
goal of Web Profile is to allow developers to create web applications with the appropriate set of technologies.
The multitier architecture of Java EE has a tremendous impact on the development of Java enterprise
applications. A Java enterprise application can be defined as a Java application that utilizes the enterprise services
offered by Java EE.
2
In fact, a web application can be classified as an enterprise application if it utilizes Java EE services in the form
of components packed in the web tier. Java EE isolates these services functionally into separate tiers, as illustrated
in Figure 2, by providing an application model on which the Java enterprise applications should be built.
An Enterprise Application
As a consequence, the Java enterprise application mirrors the multitier architecture of Java EE. Figure 3 illustrates
a generalized view of the layers of a typical web application.
Each layer in Figure 3 is an area of concern, for the application. For instance, the web layer deals only with
employing the web tier components of Java EE. Having different layers in an application results in what is called
a separation of concerns. In terms of implementation, this separation of concerns is achieved using coarse-
grained interfaces.
The concern is the feature, functionality or business functions with which the application’s developer needs to
be concerned. Crosscutting such concerns is inherent in complex systems and leads to code scattering, which is
when code for one concern spans many modules, and code tangling, which is when code in one module
concentrates on addressing multiple concerns. Code scattering and code tangling lead to a lack of clarity,
redundancy, rigidity, and continuous refactoring.
Separation of concerns, one of the main goals of software engineering, lets you handle each service on its own
and thereby does the following:
Promotes traceability within and across the artifacts in the system, throughout the life cycle of the system
Controls the impact caused by the change, thereby providing scope for evolution and noninvasive
adaptation
Promotes development of cohesive units, thereby facilitating reuse
Web Layer
The web layer of a web application consists of the web tier components of Java EE such as servlets and JSP.
The web layer can access the service layer, but there should not be a tight coupling between the web layer and
the service layer. That is, changing the service layer should not impact the web layer.
3
Service Layer
The service layer consists of the business tier components of Java EE such as Enterprise JavaBeans (EJBs). The
service layer can access the data access layer, but there should be no tight coupling between the service layer and
the data access layer. In fact, the service layer should not know anything about the web or data access layer. The
service layer provides a coarse-grained interface for the web layer.