Value List Handler



The Value List Handler provides the search and iteration functionality. To perform a search, the Value List Handler uses a Data Access Object to execute the query and retrieve the matching results from the database.
It is hard to understand this pattern so my suggestion is to go to source code section and have a look at code step by step gives you more clarity. This pattern is divided into a number of sections for simplicity like problem, forces, solution etc.

Problem

(Problem section describes the design issues faced by the developer)
You have a remote client that wants to iterate over a large results list.

Forces

(This section describes Lists the reasons and motivations that affect the problem and the solution. The list of forces highlights the reasons why one might choose to use the pattern and provides a justification for using the pattern)
  • You want to avoid the overhead of using EJB finder methods for large searches.
  • You want to implement a read-only use-case that does not require a transaction.
  • You want to provide the clients with an efficient search and iterate mechanism over a large results set.
  • You want to maintain the search results on the server side.

Solution

(Here solution section describes the solution approach briefly and the solution elements in detail)
Use a Value List Handler to search, cache the results, and allow the client to traverse and select items from the results. The Value List Handler provides the search and iteration functionality. To perform a search, the Value List Handler uses a Data Access Object to execute the query and retrieve the matching results from the database. This bypasses using the EJB finders for your applications where Business Objects are implemented as entity beans.

Read more on http://www.javaguides.net/2018/08/value-list-handler-pattern-in-java.html

Comments