EJB Design Patterns

See Also

You can leverage the UML Design Center to create Enterprise Java Beans (EJB) components. EJB design patterns address your own unique design problems. Just as GoF design patterns handle common problems in object-oriented development at large, EJB design patterns handle common problems in your specific object-oriented development. In fact, you may adapt a GoF design pattern so that it more closely mirrors a problem common in your projects. You can then place that adapted design pattern in the design pattern catalog so that it is available for repeated use.

The IDE's UML Modeling feature lets you apply EJB design patterns that are included in the UML Design Center catalog for both EJB Specification version 2.0 and EJB Specification version 1.1. The table below describes the types of EJB patterns available in the UML Design Center:

Design Pattern Description EJB Version
Bean-Managed A state where the bean developer manages transaction boundaries programmatically from the source code. 1.1 and 2.0
Container-Managed A state where the container manages the transfer of data between the entity bean instance and the underlying resource manager. 1.1 and 2.0
Message-Driven A type of bean that supports asynchronous communication. 2.0
Stateful Session A session bean class that retains state on behalf of its client across multiple methods invocations by the client. That state of the session bean is managed by the container and is not externalized to a resource manager. 1.1 and 2.0
Stateless Session A session bean class that does not retain any client-specific state between client-invoked methods. All instances of the stateless session bean are identical. 1.1 and 2.0

Note on Creating Enterprise Java Beans

Before you generate code for EJB design pattern to a java application you must ensure the EJB library is specified/loaded in the Java application; code must be generated to an enterprise project. To do so:

  1. Install IDE with J2EE SDK
  2. Create an Enterprise application
  3. Create a class diagram.
  4. From diagram canvas, invoke the context menu
  5. Apply Design pattern
  6. In the wizard, select EJB2.0 and generate class diagram.
  7. Generate code and specify the target project to the Enterprise application
See Also
Creating User-Defined Patterns
Promoting Patterns to the UML Design Center
Applying Patterns

Legal Notices