Java Reference
In-Depth Information
automate the building of many of the EJB files and deployment descriptors.
Recall that Java comments can include special Javadoc tags, such as @author
and @param . Javadoc uses these tags to generate HTML files that are the docu-
mentation of your Java classes and methods based on the text associated with
these tags. XDoclet takes this a step further and defines tags like @ejb.bean
and a few dozen more. Then, using the Javadoc mechanism, it can generate all
the various pieces required for an EJB. Used this way, you can write a single
source file for your EJB, and have XDoclet generate the various home, remote,
and local interfaces as well as the deployment descriptors.
So why aren't we all using XDoclet? It has been around for a few years and
is gaining a following in the development community. We may be moving in
that direction, but it will take some time. It adds yet another layer to what is
needed to build an EJB application, albeit a layer that brings some simplifica-
tion. Later releases of EJB specifications from Sun may subsume its EJB func-
tionality. However, it is still very important to understand the pieces that go
together to make an EJB application. One of the favorite quotes from XDoclet
in Action by Craig Walls and Norman Richards says it well: “Don't generate
what you don't understand.”
23.5
A BSTRACTING L EGACY A PPLICATIONS
One of the best uses of J2EE technology, particularly the EJB technology, is to
provide a single common interface to heterogenous systems. If an application
provides any sort of file, data, pipe, or network access to its data, you can wrap
an EJB interface around it and make it available to an entire distributed net-
work. This can be a powerful way to leverage investments in legacy systems
with modern multitier architectures.
While it is commonplace for EJB applications to interface directly to a re-
lational database back end, there is no requirement that such a system be the
back end. IBM, for example, provides Java interfaces to their mainframe legacy
data systems, such as CICS.
23.6
R EVIEW
We've looked at the contents of an EAR file—not that you'll need to be digging
inside them or even building them by hand, but you'll want to know what's
inside so as to understand what it takes to put one together. We took a look at
Search WWH ::




Custom Search