EJB Development Quickstart with MyEclipse---2
天下维客,你可以修改的网络知识库
MyEclipse EJB Project and Tools Overview
Before we begin, here's a quick word about MyEclipse EJB Projects and Tools. First, what is a MyEclipse EJB Project and why is it important?
A MyEclipse EJB Project is:
A basic Eclipse Java project that includes a META-INF directory and additional metadata required by the MyEclipse EJB Tools, such as the EJB Creation Wizards and the MyEclipse Deployment Services. Thus, standard Eclipse and 3rd party Java tools may be used within a MyEclipse EJB Project.
You can distinguish MyEclipse EJB Projects from other project types by the project icon,
. Figure 1 depicts the structure of an example EJB project that we will create during this document. Note the META-INF folder located under the src folder and the metadata files. META-INF is a special J2EE directory that contains the Java MANIFEST.MF file, the standard EJB deployment descriptor (ejb-jar.xml) and application server specific deployment descriptors, e.g., jboss.xml. The MyEclipse New EJB Project Wizard creates the META-INF folder as a child of a Java source folder to enable it for deployment to your favorite application server that supports an EJB container.
Figure 1. Example EJB Project
Also depicted in Figure 1 are the project's metadata files. Note these files are typically hidden in the default Eclipse views due to the default use of the .* filename filter that hides dot prefixed files. The .project and .classpath files are standard Eclipse project information files. The .mymetadata and .xdoclet files are MyEclipse metadata files and are required for MyEclipse tools to function properly. Do not delete or modify these files. Also, if your project is managed by a source-code management tool such as CVS be sure to include all these files as part of the project.
MyEclipse EJB Development Tools include:
- EJB Creation Wizard
- EJB XDoclet Attribute-oriented programming environment
- Java editor enhancements to support code completion for XDoclet annotations and J2EE APIs
- Auto-generation of EJB and Home interfaces and lookup utilities
- ejb-jar.xml and application server specific deployment descriptor generation
- XML editor for deployment descriptor customization
- EJB Deployment Services
A special note about attribute-oriented programming and XDoclet technology: MyEclipse provides sophisticated support for attribute-oriented programming using XDoclet technology and tools. MyEclipse EJB Tools, such as the EJB wizards and code generation features, rely on XDoclet for much of their operation. For example, the EJB Creation Wizard generates XDoclet 1.2 compliant EJB bean classes for Session, Entity, and Message-driven EJB's. XDoclet is then employed to auto-generate and maintain the bean's home and remote interfaces as well as the ejb-jar.xml deployment descriptor.
While you are not required to use MyEclipse XDoclet capabilities in your development process, we believe the productivity gains from doing so far exceed counter arguments against the use of attributes. We support our recommendation for the use of attribute annotations by noting that: 1) native attribute support was recently incorporated into the latest release of the Java SDK, and 2) attribute annotations are anticipated to be the primary mechanism employed by the upcoming EJB 3.0 specification to greatly simplify EJB definition and maintenance efforts.



