What Is the J2EE Platform?
The J2EE platform is particularly suited
for the development and deployment of enterprise Web-based
applications that use the Java programming language. Its
architecture provides both server- and client-side support for
both enterprise and Web-based applications that run in
multi-tiered environments. The figure below shows the J2EE
support for a typical multi-tier architecture.

Multi-tier applications usually are configured into
three parts: a client tier, a middle tier, and an EIS tier. The
client tier may include browser-based clients, peer enterprise
applications, and Java-based client applications. The middle tier
supports modules that provide application services to the client
and that implement the application's business logic. Keep in mind
that there can be more than one such middle tier. The enterprise
information system (EIS) tier (sometimes referred to as the
back-end tier) supports the enterprise information systems that
manage and store enterprise critical data and functions. The
Connector architecture integrates applications that are in the
middle tier application server with the EIS tier.
For example, the J2EE architecture supports
multi-tier applications that might be divided along the following
lines:
• A Web browser-based client. Often, such a client encompasses
the presentation logic.
• An application server with an EJB container and a Web
container. The EJB container handles the business logic tier. The
Web container, using servlets, JSPs, and so forth, provides
services for the generation of dynamic and static content
targeted for Web browser-based clients.
• A relational database or legacy system such as the EIS tier,
connected to the middle tier via the Connector architecture.
The J2EE architecture is designed to support
distributed application development. That is, in a J2EE
multi-tier environment, each part of the application can run on a
different platform or node. In fact, the middle tier itself is
not restricted to one tier, but may be divided into sub-tiers and
these sub-tiers distributed across nodes.
Components and Containers
Conceptually the J2EE architecture divides the
programming environment into containers. A container is a
standardized runtime environment that provides specific services
to components. A component is an application-level software unit
that is supported by a container. In the J2EE environment, a Web
container provides standard Web-specific services, whereas an EJB
container provides services to support enterprise bean
components. For example, an EJB container provides such services
as transaction management, security, multi-threading, distributed
programming, and connection pooling. A Web container provides
communication APIs and protocols and network services to
facilitate sending and receiving requests and responses.
Keep in mind that all J2EE-compliant platforms,
regardless of the vendor, are required to provide these services.
The figure below illustrates the J2EE component types and their
containers. It is a good road map to help you understand the
discussion that follows.

The J2EE client tier supports a variety of client
types. A client may be a Web browser using HTML pages, or it may
use dynamic HTML generated with JSP technology. A client may be a
Java applet or a standalone Java application. J2EE clients access
the middle tier using standard Web communication protocols. In
multi-tier environments, they never directly access the EIS tier.
The middle tier consists of the Web and EJB
containers, plus other services, such as Java Naming and
Directory Interface (JNDI), JMS, JavaMail, and so forth. The Web
container provides the programming environment for developing and
deploying servlets and JSPs. Typically, servlets and JSPs
encompass an application's presentation logic and the logic that
controls client interaction. Web components, when packaged
together, comprise a Web application. The Web container, through
servlets and JSPs, provides runtime support for receiving HTTP
requests and composing HTTP responses to these requests. It
ensures that results are returned to the requesting client.
The EJB container, which is also in the middle tier,
provides the environment for developing and running enterprise
bean components. It is often considered the backbone of the J2EE
programming environment. Enterprise bean components are Java code
that implement an enterprise's business processes and entities.
They perform the application's business operations and
encapsulate the business logic. The EJB container automatically
handles transaction and life-cycle management for its enterprise
bean components. In addition, the EJB container provides other
services to its beans, such as lookup and security services, and
standardized access via the Connector architecture to the EIS
tier database or legacy system.
What are the advantages and benefits of using the
J2EE platform? Among other benefits, the J2EE platform offers
developers a simplified development environment that scales
easily and can be integrated with existing systems and
applications. It also gives developers the flexibility to choose
servers, tools, or other components that best fit their needs,
and to customize the security model for their needs. Vendors and
customers alike benefit from the J2EE platform, as follows:
• Enterprise system vendors can implement compliant products
that are also customizable.
• Corporate information technologists benefit from the
advantages of portable component technology—they can focus on
supporting business process requirements rather than handling
distributed infrastructure integration problems.
J2EE Technologies
As we've already noted, the J2EE platform specifies
technologies to support multi-tier, distributed application
development. These supported technologies are divided into three
categories: components, services, and communication.
Components are separate application modules—that
is, separate application-level software units—that can be
reused by other enterprise applications. (Technically speaking, a
component is a reusable piece of software that encapsulates data
and behavior, has a defined life-cycle model, and provides
services to clients. Components can be packaged together to
compose an application.) Generally these component technologies
encompass the technologies used by developers to create the
business logic and user interface portions of the application.
The J2EE platform supports several different kinds of components,
such as Enterprise JavaBean (EJB)
components, Web components (servlets
and JSPs), and application clients,
including applets. Typically, application clients and applets run
on a client platform, whereas enterprise bean and Web components
run on a server platform.

Enterprise service technologies encompass the APIs that
provide access to existing enterprise services. These APIs
pertain to database access, transactions, naming and directory
services for lookup capabilities, and messaging services. The
J2EE technology also enables communication between clients and
servers. It also supports distribution protocols and mechanisms
between multiple servers.
The J2EE platform also provides service technologies. These
are the system-level services that support the other technologies
and simplify application development. The principal services
provided by the J2EE platform are naming, deployment,
transaction, and security services.
The Java Naming and Directory Interface
(JNDI) provides naming and directory functionality. It
provides a means for an application to locate components that
exist in a name space according to certain attributes. A J2EE
application component uses the JNDI interfaces to look up and
reference system-provided and user-defined objects in the
component environment.
The J2EE deployment services allow users to customize
components and applications when they are deployed in an
operational environment. A deployment descriptor file is an XML
document. Its elements declaratively describe how to assemble
components and deploy the parts of the application into a
specific environment. Users can customize the deployment
descriptor for an application.
Transaction services are another important service of the J2EE
platform. The J2EE platform manages transactions for an
application. It provides for failure recovery and handles
multi-user programming, thus ensuring that each transactional
unit of work fully completes without interference from other
processes. The platform provides the Java
Transaction API (JTA) so that applications can use
transactions.
Within the EJB container, transactions may be controlled
completely by the container (container-managed transactions) or
they may be handled by the enterprise bean itself (bean-managed
transactions). With container-managed transactions, the EJB
container handles all aspects of a transaction—starting the
transaction, maintaining and propagating transaction context, and
committing or rolling back the transaction—based on elements in
the deployment descriptor. When bean-managed transactions are
used, the enterprise bean itself must manage these aspects of a
transaction.
The J2EE platform also provides security services that ensure
authorized access to resources. These security services control
access through a two-step process of authentication and
authorization. A principal, which is typically a user or another
program, authenticates itself by providing a name and password,
referred to as its authentication data. Once authenticated, a
principal must have the correct authorizations to access a
particular resource. The J2EE platform authorization is based on
security roles, which are logical groupings of users defined for
the application environment.
The JDBC API provides
database-independent connectivity between the J2EE platform and a
wide variety of relational databases. Using the JDBC API, an
application can perform such functions as connect to a database
server, manage transactions, execute stored procedures and SQL
statements, and retrieve stored data.
The J2EE platform provides a messaging technology for
asynchronous messaging. Java Message
Service (JMS) is an API for using enterprise messaging
systems. Such messages contain information describing specific
business actions. JMS supports both point-to-point queue-based
and publish-subscribe messaging.
JavaMail is an API for an
electronic mail system. Its abstract classes and interfaces
support various implementations of message stores, formats, and
transports. JavaMail uses the JavaBeans Activation Framework (JAF)
to integrate support for MIME data types into the Java platform.
Applications do not use JAF directly.
The Remote Method Invocation (RMI)
set of APIs allows developers to build distributed applications
in the Java environment. RMI-IIOP is an implementation of the RMI
API over the Internet Inter-ORB Protocol (IIOP). This
implementation permits developers to write remote interfaces in
Java. The remote interface can be converted to the Interface
Definition Language (IDL) and then can be implemented in any
other language that supports Object Management Group (OMG)
protocols and includes an Object Request Broker (ORB) library.
Thus RMI-IIOP provides interoperability with CORBA objects
implemented in any language.
|