Multiple choice technology architecture

Design a shopping web application, which on a query will return arbitarily more number of records. But the requirement is to display only 10 records maximum per page. Also, you are not supposed to execute the same query to fetch the next result set. Also, user should be able to navigate to all the search results back & forth. So, what type of design pattern will be used?

  1. Observer Pattern

  2. Intercepting Filter

  3. Iterator pattern

  4. Value List Iterator pattern

  5. Facade pattern

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The Value List Iterator (J2EE) pattern is specifically designed for handling large result sets with pagination. It maintains the original query results and allows traversal through chunks (pages) without re-executing the database query, meeting all the stated requirements. Observer is for notifications, Intercepting Filter modifies requests/ responses, Iterator is a basic traversal pattern, and Facade simplifies interfaces.