Home > Articles > Programming > Java

  • Print
  • + Share This
From the author of

EJB Development Considerations and Steps

The steps to developing EJBs can be partitioned along two main lines: server-side and client-side development. Although server-side development of distributed communications servers, such as CORBA and RMI, takes on a somewhat-complicated nature at times, server-side development of EJBs is simplified because much of the communications, state management, resource allocation, and thread management infrastructure coding is provided by the container. These are the main steps employed for server-side EJB development:

  1. Implement EJB standard interfaces—Any interfaces required by the standard EJB component model to enable container-based management of the EJB should be implemented.

  2. Implement EJB business-specific interfaces—Any business-specific interfaces provided by your EJB and any supporting helper and utility classes should be implemented.

  3. Create client remote interfaces—The remote interface for your EJB that defines all business-specific interfaces to the EJB should be created.

  4. Create client home interfaces—The home interface for your EJB that defines the application-specific methods for creating your EJB, as well as application-specific methods for finding your EJB (if it is an entity bean), should be created.

  5. Compile EJB code—The EJB implementation, home interface, and remote interface should be compiled.

  6. Configure module deployment descriptors—The standard EJB deployment descriptor should be configured to define the specific structural characteristics and dependencies of your EJB. Any deployment descriptors needed by your container/server provider should also be configured.

  7. Package EJB into an EJB JAR module—The standard EJB deployment descriptor, any vendor-specific deployment descriptors, and one or more of your compiled EJB class files should be packaged into an EJB JAR module.

  8. Configure application deployment descriptor—A standard J2EE deployment descriptor should be configured for a cohesive collection of J2EE modules.

  9. Package EJB Modules into a J2EE EAR Application—The standard J2EE deployment descriptor and one or more EJB JAR files should be packaged into a J2EE EAR application.

  10. Deploy the J2EE application—The J2EE EAR application should be deployed to a J2EE-compliant application container/server environment.

On the client side, clients must simply be designed to utilize the proper EJB client interfaces and libraries. EJB client development proceeds along the following lines:

  1. Standard client library verification—The proper EJB client libraries must be established.

  2. EJB client interface generation—The properly compiled interfaces and stubs specific to a particular EJB must also be provided to an EJB client.

  3. Client implementation—The EJB client may be implemented to utilize any interfaces as appropriate.

  4. Client code compilation—The EJB client code should be compiled.

  5. Configure application client deployment descriptors (optional)—Any standard J2EE application client deployment descriptor should be configured to define the specific configuration properties of your EJB client.

  6. Package client into application client JAR (optional)—The standard J2EE application client deployment descriptor and compiled EJB client class files should be packaged into a J2EE application client JAR.

  7. Launch the J2EE application client (optional)—The J2EE application client may be launched within a special J2EE application client container environment.

  • + Share This
  • 🔖 Save To Your Account