Java Reference
In-Depth Information
8.4.7
Overall solution: Pick the right bean for the job
Table 8.3 shows the different EJB classifications, the general characteristics of
appropriate solutions, and a list of problems that it can solve. Doubtlessly,
EJB s will continue to evolve, and the imbedded services such as container-
managed persistence and session states will become more robust. Table 8.3
describes the state of the art, as we understand it today.
Table 8.3 This table shows each EJB classification, with a generic description of the types of
problems that it can solve. The last classification is not an EJB, but is used to categorize
solutions that are not well suited for EJBs.
EJB classification
Description
Solution examples
Entity beans (container
managed)
Transactional, shared, persistent.
Simple object relationships.
Server-side persistent object
models.
Entity beans (bean
managed)
Transactional, shared, persistent.
Complex object relationships.
Optimizations for the above,
with relational joins, or persis-
tence to other data stores.
Stateless session beans
Transactional distributed access
without state requirements.
Adding transactional integrity to
a method or procedure.
Adding a facade to consolidate
interfaces across major inter-
face boundaries.
Stateful session beans
Transactional, distributed access
with limited conversational state
requirements, within the bounds
of a single session.
Saving session state.
Scrolling through large, multi-
part lists.
None
Not necessarily transactional, per-
sistent, shared, or secure. All
aspects of an application that do
not have compelling reasons to be
EJBs should not be EJBs. This is
the default implementation.
Log and property files.
Quick hitters that do not belong
in the model.
Nontransactional data.
User interface-related aspects
of the application.
Search WWH ::




Custom Search