Access beans are Java™ bean representations of enterprise beans. They are typically used in client programs that employ JavaServer Pages (JSP) files, servlets, or enterprise beans that interface with other enterprise beans. 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, which greatly simplifies your enterprise bean client programs and helps reduce your overall development time.
To understand how access beans solve the problem of performance degradation in client-to-enterprise bean interactions, it is helpful to review how a client program typically accesses an enterprise bean:
Since each client call to an enterprise bean proxy object is a remote call, performance declines if an enterprise bean has numerous attributes and multiple remote calls are made to set or get the attributes. Access beans solve the performance problem by simply caching server-side data, such as entity data, on the client side. A local cache of enterprise bean attributes significantly improves access speed to an enterprise bean.
There are four types of access beans that you can develop in the workbench:
Java bean wrapper and copy helper access beans developed in the workbench are similar to the Java bean wrapper and copy helper access beans used in VisualAge® for Java. (Note, however, that in the workbench there is no support for the rowset access beans used in VisualAge for Java.)
Note: Data access beans and copy helper beans cannot be created for session beans. Only Java wrapper access beans can be created for session beans. This not a limitation, this is by design. All access bean types can be created for entity beans.
By comparison, EJB factories and data classes are new types of access beans that are specific to Application Developer. Since EJB factories are like Java bean wrappers and data classes are like copy helpers, they can replace the function provided by Java bean wrappers and copy helpers. However, unlike the relationship between copy helpers and Java bean wrappers, data classes are not a superset of EJB factories.
The new technology that underlies EJB factory and data class access beans
simplifies the process of creating or editing access beans. You can use the
Create an Access Bean wizard or the Edit an Access Bean wizard to easily create
or edit data class access beans. If you have an existing application that
employs access beans that were created in VisualAge for Java, you
can use the wizards to create or edit Java bean wrapper or copy helper access
beans. However, if you are developing a new application, it is recommended
that you create only data class access beans, which employ the new technology.
EJB factories are automatically created by the Create an Access Bean wizard
regardless of whether you choose to create a data class, Java bean
wrapper, or copy helper. For this reason, EJB factories do not appear on the
selection page of the Create an Access Bean wizard, where you specify the
type of access bean that you want to create.