WebSphere Commerce enterprise beans

The persistence layer within the WebSphere Commerce architecture is implemented according to the EJB component architecture. The EJB architecture defines two types of enterprise beans: entity beans and session beans. Entity beans are further divided into container-managed persistence (CMP) beans and bean-managed persistence (BMP) beans.

Most of the WebSphere Commerce entity beans are CMP entity beans. A small number of stateless session beans are used to handle intensive database operations, such as performing a sum of all the rows in a particular column. One advantage of using CMP entity beans is that developers can utilize the EJB tools provided in WebSphere Commerce Developer. These tools allow developers to define Java objects and their database table mappings. The tools automatically generate the required persisters for the entity beans. Persisters are Java objects that persist Java fields to the database and populate Java fields with data from the database.

WebSphere Commerce uses EJB 2.x modules, but most of the entity beans are at EJB 1.1 level. IBM WebSphere Commerce Developer provides two extensions to the EJB 1.1 specification: EJB inheritance and association. EJB inheritance allows an enterprise bean to inherit properties, methods, and method-level control descriptor attributes from another enterprise bean that resides in the same group. An association is a relationship that exists between two CMP entity beans.

Some of the WebSphere Commerce entity beans exploit the EJB inheritance feature. The WebSphere Commerce entity beans do not use the associations feature. To minimize complexity in the object model it is recommended that you do not use the association feature when developing entity beans. Instead of using associations, use object relationship between enterprise beans. Do this by adding explicit getter methods in the enterprise beans.

WebSphere Commerce provides two sets of enterprise beans: private and public. Private enterprise beans are used by the WebSphere Commerce runtime environment and tools. You must not use or modify these beans.

Public enterprise beans, on the other hand, are used by commerce applications, and can be both used and extended. These public enterprise beans are organized into the following EJB modules:

  • Catalog-ProductManagementData
  • ContentManagement-WorkspaceFlowData
  • Enablement-BaseComponentsData
  • Enablement-RelationshipManagementData
  • Enablement-TicklerData
  • GiftRegistry-BaseComponentsData
  • GiftRegistry-OrderIntegrationData
  • Marketing-CampaignsAndScenarioMarketingData
  • Marketing-CustomerProfilingAndSegmentationData
  • Marketing-ExperimentationManagementData
  • Member-MemberManagementData
  • Merchandising-PromotionsAndDiscountsData
  • Order-OrderCaptureData
  • Order-OrderManagementData
  • WebSphereCommerceServerExtensionsData
  • WebSphere Commerce Enterprise Trading-AuctionsAndRFQsData

Some of the EJB modules in the preceding list contain session beans. In order to simplify migration in the future, you should not modify a session bean class. If required, you can create a new session bean in the WebSphereCommerceServerExtensionsData EJB module. For more information about creating new session beans, refer to Writing new session beans.

A program that uses enterprise beans must deal with the Java Naming and Directory Interface (JNDI) as well as the home and remote interfaces of enterprise beans. To simplify the programming model, an access bean for each enterprise bean is generated. When creating your own enterprise beans, use the tooling in IBM WebSphere Commerce Developer to generate this access bean.