Access beans

HCL Commerce commands interact with access beans rather than directly with entity beans. EJB access beans can greatly simplify client access to enterprise beans and alleviate the performance problems that are associated with remote calls for multiple enterprise bean attributes.

Access beans are Java™ bean representations of enterprise beans. In HCL Commerce, access beans are used in Controller commands and Task commands. Access beans shield you from the complexities of managing enterprise bean life cycles. This means that you can program to enterprise beans as easily as you can program to Java beans. This greatly simplifies your enterprise bean client programs and helps reduce your overall development time.

Note: On the access bean, the get and set methods are not automatically cached. Only the methods that are part of the copy helper object are cached. The getters and setters on the remote interface are invoked when called.

In most cases, 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. There are three types of access beans: Data class, Copy helper, and bean wrapper. We use the Copy helper for Entity beans and we use the Java bean wrapper for Session beans. When you create your own enterprise beans, you can use HCL Commerce Developer to generate this access bean.

The following diagram displays the interaction between commands, access beans, entity beans, and the database.

Diagram showing the interaction between commands, access beans, entity beans, and the database, as detailed in the previous paragraph.