Java BluePrints

Fast Lane Reader

Context

System accesses lists of read-only data in a tabular fashion.

Problem

Using objects to represent persistent, tabular, read-only data incurs performance costs for no benefit.

Forces

Solution

Access persistent data using a data access object (DAO) instead of using enterprise beans. The DAO accesses the data using the mechanism that is most efficient for the data source, and provides the client with a natural, tabular interface. The client avoids the associated overhead of enterprise beans. The client must be tolerant of data that are somewhat stale, since the DAO circumvents the concurrency control that would otherwise be provided by enterprise beans.

Structure

The following class diagram represents the Fast Lane Reader pattern:

Participants & Responsibilities

Strategies

A fast-lane reader is typically implemented as a data access object. The DAO shields clients that use the fast-lane reader from the actual implementation of the resource being accessed.

Consider the following issues when implementing this pattern:

Consequences

The main benefit of this pattern is faster data retrieval.

This pattern also has the following liabilities:

Related Patterns

Data Access Object: A DAO facilitates fast-lane read access by encapsulating the logic required to retrieve the data from a resource.

Value List Handler: A value list handler can break up long lists of data retrieved through a fast-lane reader into manageable pieces.


© 2000-2002 Sun Microsystems, Inc. All Rights Reserved.