Java Reference
In-Depth Information
from one or more entity beans, which cannot be passed to the presentation
tier because they are permanently attached to the database. Implementing
the DTO s and the code that creates them is one of the most tedious aspects
of implementing an EJB .
Developing EJB s can be a slow, mind-numbing process. While you can get used to
it and find ways to occupy your time while waiting for components to deploy, it isn't
a good way to develop software. As I mentioned earlier, the nature of J2EE develop-
ment with EJB precludes many of the best practices common in other types of Java
development. Because the components must run in the application server in order
to access the services it provides, an incremental development strategy that fre-
quently executes the edit-compile-debug cycle is difficult. Eventually, many enter-
prise Java developers have become painfully aware of these limitations and have
started to ask questions: Does the development I'm doing require all these services
for which I'm paying such a high price? Is this the right tool for the job?
1.1.4
EJB 3 is a step in the right direction
The EJB standard isn't frozen in amber. The designers of the specifications at Sun
listen to developers and are modifying the EJB specification accordingly. The
main goal of the newest EJB 3 standard is to simplify EJB development. It addresses
some of the perceived problems and issues with the current specification:
EJB s are POJO s, there is a lot less boilerplate code to write, and the code is
less coupled to the application server environment.
EJB 3 entity beans are intended to be the standard Java persistence mecha-
nism and run in both J2EE and J2SE environments.
EJB 3 supports the use of Java 5 annotations instead of difficult-to-write
deployment descriptors to specify such things as transaction attributes, secu-
rity attributes, and object/relational mapping.
Entity beans support inheritance (finally!), making it possible to implement
a true object model.
EJB 3 also has reasonable defaults for much of the deployment information,
so there is a lot less of it to write.
EJB 3 entity beans can be used to return data to the presentation tier, which
eliminates the need to write DTO s.
EJB 3 still has limitations. For example, it forces components into three categories—
session beans, entity beans, and message-driven beans—even though in a typical
 
 
 
Search WWH ::




Custom Search