1.6 Introduction to Containers
-
Normally, thin-client multitiered applications are hard
to write.
-
Because they involve many lines of intricate code to
handle :
1)
transaction and state management,
2)
multithreading,
3)
resource pooling, and
4)
other complex
low-level details.
-
The component-based and platform-independent J2EE architecture
makes J2EE applications easy to write.
-
Because business logic is organized into reusable
components.
-
In addition, the J2EE server provides underlying
services in the form of a container for every component type.
-
Because we do not have to develop these services werself,
we are free to concentrate on solving the business problem at hand.
Container Services :-
-
Containers are the interface between a
component and the low-level platform-specific functionality that supports the component.
-
Before a Web, enterprise bean, or application client
component can be executed, it must be assembled into a J2EE application and
deployed into its container.
-
The assembly process involves specifying container
settings for each component in the J2EE application and for the J2EE
application itself.
-
Container settings customize the underlying support
provided by the J2EE server.
-
Which includes services such as :
1)
security,
2)
transaction management,
3)
Java Naming and Directory Interface
(JNDI) lookups, and
4)
remote connectivity.
-
Means that application components within the same J2EE
application can behave differently based on where they are deployed.
-
For example, an enterprise bean can have security
settings that allow it a certain level of access to database data in one
production environment and another level of database access in another
production environment.
-
The container also manages nonconfigurable services
such as :
1)
Enterprise bean and servlet life cycles,
2)
Database connection resource pooling,
3)
Data persistence, and
-
Although data persistence is a nonconfigurable service,
the J2EE architecture lets we override container-managed persistence.
-
By including the appropriate code in wer enterprise
bean implementation when we want more control than the default
container-managed persistence provides.
-
For example, we might use bean-managed persistence to
implement wer own finder (search) methods or to create a customized database
cache.
Container Types :-
-
The deployment process installs J2EE application
components in the J2EE containers illustrated in Figure.
-
Manages the execution of enterprise beans for J2EE
applications. Enterprise beans and their container run on the J2EE server.
-
Web components and their container run on the J2EE
server.
-
Application clients and their container run on the
client.
-
Manages the execution of applets.
-
Consists of a Web browser and Java Plug-in running on
the client together.
No comments:
Post a Comment