5.6. Design Guidelines and Patterns

This chapter contrasts stateless session beans with stateful session beans. We discuss situations where each is the preferable choice for implementing an EJB. To implement the Value List Iterator Pattern, we use a stateful session bean to control a data-intensive stateless session bean.

Value List Iterator Pattern

In situations where an enterprise application requests a large amount of data, the Value List Iterator Pattern eases network load and the resource consumption caused by large data returns. Instead of receiving all the data at once, the client controls the amount by requesting data a page at a time. Furthermore, the client can control how many elements a page contains.

Our implementation of this pattern ...

Get Enterprise JavaBeans™ Component Architecture: Designing and Coding Enterprise Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.