Information Technology Reference
In-Depth Information
The components that make up the application are executed in runtime envi-
ronments called containers. Containers are used to provide infrastructure-type
services such as life-cycle management, distribution, and security. Containers
and components in the J2EE application are broadly divided into three tiers.
The client tier is typically a Web browser or alternatively Java application cli-
ent. The middle tier contains two primary containers of the J2EE application,
namely, Web container and EJB container. The function of the Web container
is to process client requests and generate corresponding responses, while the
function of the EJB container is to implement the business logic of the applica-
tion. The EIS tier primarily consists of data sources and a number of interfaces
and APIs to access the resources and other existing or legacy applications.
6.2.2.1 JavaServer Pages and Java Servlets as the
User Interaction Components
JSP and Java Servlets are meant to process and respond to Web user request.
Servlet provides a Java-centric programming approach for implementing
Web tier functionality. The Servlet API provides an easy-to-use set of objects
that process HTTP requests and generate HTML/XML responses. JSPs pro-
vide an HTML-centric version of the Java Servlets. JSP components are docu-
ment based rather than object based and possess built-in access to Servlet API
request and response objects as also the user session object. JSPs also provide
a powerful custom tag mechanism, enabling the encapsulation of reusable
Java presentation code that can be placed directly into the JSP document.
6.2.2.2 Session Bean EJBs as Service-Based Components
Session Beans are meant for representing services provided to a client. Unlike
Entity Beans, Session Beans do not share data across multiple clients—each
user requesting a service or executing a transaction invokes a separate
Session Bean to process the request. A stateless Session Bean after process-
ing a request goes on to the next request or next client without maintaining
or sharing any data. On the other hand, stateful Session Beans are often con-
structed for a particular client and maintain a state across method invoca-
tions for a single client until the component is removed.
6.2.2.3 Entity Bean EJBs as the Business Object Components
Entity Beans are meant for representing persistent data entities within an
enterprise application. One of the major component services that are pro-
vided to the Entity Beans is that of Container Managed Persistence (CMP).
However, in EJB 2.0 specification, CMP persistence is limited to one table
only. Any object-relational mapping involving more than a one-to-one table-
object mapping is supported only through Bean-Managed Persistence (BMP)
(see “Entity Beans”).
Search WWH ::




Custom Search