To manipulate data, a presentation bean calls a data manipulation method of
DataDirector
. After the requested manipulation is performed, DataDirector
returns an instance of an object that implements the DataAccess
interface. This DataAccess
object contains the requested data and
is returned as an argument when DataDirector
fires an event such
as DataChanged
. A presentation bean that is listening for the
event receives the DataAccess
object. At that point, the presentation
bean should begin using only the data from the new DataAccess object because
the previous data may be invalid.
The fact that the DataAccess
and DataDirector
interfaces are separate, provides flexibility in implementation. You can choose to implement these interfaces in a single class or in separate classes.
The class oracle.dss.util.DataAccessAdapter
provides a default
implementation of both DataAccess
and DataDirector
in a single class.
Implementing DataAccess
and DataDirector
in separate classes can be useful in situations where you want to handle data events asynchronously or manage multiple data cursors.