Database Reference
In-Depth Information
Web
browser
Entity
bean
Servlet
Database
HTTP
request
JDBC
Session
bean
Wireless
device
RMI
RMI/
local
inter-
face
J2EE
connector
Enterprise
application
JSP
HTTP
response
B2B Web
Service
client
User
interaction
architecture
Service-
based
architecture
Business
object
architecture
Web
container
EJB
container
Enterprise
information
tier
Client
tier
Middle
tier
Figure 11.2
enterprise Application in J2ee.
(HTTP) requests and generate HTML/XML responses. JSPs provide an HTML-centric version
of the JavaServlets. JSP components are document 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 presenta-
tion code that can be placed directly into the JSP document.
11.2.3.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 execut-
ing a transaction invokes a separate Session Bean to process the request. A stateless Session Bean
after processing 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 constructed for a particular client
and maintain a state across method invocations for a single client until the component is removed.
11.2.3.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 provided 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 Section 11.2.3.4.1.3 “Entity
JavaBeans (EJB)”).
Search WWH ::




Custom Search