13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

518Chapter 23Deploying EJBsautomate the building of many of the EJB files and deployment descriptors.Recall that Java comments can include special Javadoc tags, such as @authorand @param. Javadoc uses these tags to generate HTML files that are the documentati<strong>on</strong>of your Java classes and methods based <strong>on</strong> the text associated withthese tags. XDoclet takes this a step further and defines tags like @ejb.beanand a few dozen more. Then, using the Javadoc mechanism, it can generate allthe various pieces required for an EJB. Used this way, you can write a singlesource 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 andis gaining a following in the development community. We may be moving inthat directi<strong>on</strong>, but it will take some time. It adds yet another layer to what isneeded to build an EJB applicati<strong>on</strong>, albeit a layer that brings some simplificati<strong>on</strong>.Later releases of EJB specificati<strong>on</strong>s from Sun may subsume its EJB functi<strong>on</strong>ality.However, it is still very important to understand the pieces that gotogether to make an EJB applicati<strong>on</strong>. One of the favorite quotes from XDocletin Acti<strong>on</strong> by Craig Walls and Norman Richards says it well: “D<strong>on</strong>’t generatewhat you d<strong>on</strong>’t understand.”23.5ABSTRACTING LEGACY APPLICATIONSOne of the best uses of J2EE technology, particularly the EJB technology, is toprovide a single comm<strong>on</strong> interface to heterogenous systems. If an applicati<strong>on</strong>provides any sort of file, data, pipe, or network access to its data, you can wrapan EJB interface around it and make it available to an entire distributed network.This can be a powerful way to leverage investments in legacy systemswith modern multitier architectures.While it is comm<strong>on</strong>place for EJB applicati<strong>on</strong>s to interface directly to a relati<strong>on</strong>aldatabase back end, there is no requirement that such a system be theback end. IBM, for example, provides Java interfaces to their mainframe legacydata systems, such as CICS.23.6REVIEWWe’ve looked at the c<strong>on</strong>tents of an EAR file—not that you’ll need to be digginginside them or even building them by hand, but you’ll want to know what’sinside so as to understand what it takes to put <strong>on</strong>e together. We took a look at

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!