About the Oracle ADF Binding Context

In a J2EE application that uses the Oracle ADF model, model data is surfaced to the view and controller layers through data control objects implemented for each type of data provider. A model-specific set of data controls:

Once the data is surfaced by data control adapter classes, interaction with the business service by the J2EE application is possible by any method that acts on or retrieves data from data objects and collections (also described as rows and row sets).

At runtime, the interaction with the business services initiated from the client or controller is managed by the application through a single object known as the Oracle ADF model binding context. The ADF binding context is a container object that defines a hierarchy of data controls and data binding objects derived from the Oracle ADF model layer, as shown in the following figure.

Oracle ADF binding context block diagram

The binding context defines these hierarchies, whose objects reference one another in order to allow the Oracle ADF model to service the controller and view layers.

This hierarchy for the data controls looks like this:

The hierarchy for the data binding objects, which also start from the same parent container, looks like this:

and, additionally:

The following diagram depicts binding container containment hierarchy in detail. Note that the definition of the binding context and the data binding objects available to the application are specified by XML-based files at the level of the client project.

Oracle ADF binding context block diagram

Through the iterator binding's object hierarchy path, the iterator binding accesses the data collection and iterates over its data objects. In constrast, value binding objects allow UI components to display or update the current data object of the collection being iterated over.

For example, in the source of the web page or Java panel, a UI component's value binding definition references the page or panel's iterator binding object. The iterator binding object, in turn, references the data controls, which complete the data-access path and allow the Oracle ADF model to traverse the object hierarchy:

  1. Starting from an event (such as rendering the data) that is received by the control binding
  2. All the way back to the data controls of the binding context that interacts finally with business services

Note: The above description has been simplified to include both web applications and Java client applications. In an actual web application, the controller layer is responsible for populating the Oracle ADF model binding context prior to dispatching to the view layer. Then, following the pull model for interactive web applications, the view layer pulls the data to render values in the page.

The definition of the binding context and the data binding objects available to the application are specified by XML-based files at the level of the client project as described in the following section.

About MetaData for the ADF Binding Context

Using the JDeveloper design time, the application developer creates a set of XML files that declaratively define the ADF bindings and data controls. At runtime, the application creates the Oracle ADF binding context from the files in the application, as shown in the following figure.

Shows relationship of ADF files and data binding objects

The client binding description file (.cpx) references the binding definitions in the client binding container definition files ( .xml). The .cpx file also contains a reference to the data control description file (.dcx), which specifies the data control factory to use for a specific business service. For a more complete description of these files, see About the ADF-Specific Project Files.

The design time supports creating these files through your interaction with the Data Control Palette, visual editor, the Structure window, and the Property Inspector. After you use the Data Control Palette to insert a databound UI component into the displayed web page or JClient panel, the binding definition is created in the document's binding definition file. Additionally, source code is added to the document that references the binding objects, which the application makes available through the ADF binding context bindings namespace.

For more information about these design time tools, see About the Design Time for Oracle ADF.

Oracle ADF Model API Overview

Specifically, these objects in the ADF model layer provide runtime access to business services:

binding context object ( oracle.adf.model.BindingContext)
Defines a common namespace for use by the client application and allows all model objects to be exposed through a convenient root name. Each web page or Java panel registers with the binding context using the definition for the variable name binding.
data control interfaces ( oracle.adf.model.binding.DCDataControl)
Provides the client application with an interface into the model objects. One data control is needed to wrap the model objects of each business service configuration. Also, in the case of a JavaBeans model object, provides developers with direct access to the native object, when programmatic access is desired.
binding container objects ( oracle.adf.model.binding.DCBindingContainer)
Defines a container for data binding objects, including iterator bindings and control bindings. One binding container is created for each web page or Java panel, but may be reused in multiple pages and panels when they share the same data. The binding container object also lets you specify whether the page or panel is to be used in data entry mode or query mode.
iterator binding objects ( oracle.adf.model.binding.DCIteratorBinding)
Handles the events generated from the associated business service row iterator and sends the current row to individual control bindings to display current data. Iterator bindings can specify the number of rows to display in a web page.
control binding objects ( oracle.jbo.uicli.binding.JUControlBinding)
Defines the way a specific UI component interacts with the corresponding business service. For example, depending upon the control binding selection, a text field may be bound to an Oracle ADF Business Components view object attribute and display as an editable field or a static label. Or, if the business service attribute defines an enumerated list of values, the bound UI component might display a static list, a single-selection list, or a multi-selection list. Other, more complex UI components, such as table and graphs, are also supported by their own control bindings.
action binding objects ( oracle.jbo.uicli.binding.JUCtrlActionBinding)
At runtime, when the user initiates the action, using a button control, the action binding accesses the Oracle ADF binding context and initiates the specified action on the data objects of the selected collection. Action bindings can take parameters that will be passed to the controller to handle.

For information about the data controls in Oracle ADF:

To customize the data bindings:

To understand the process for creating either Model 1 or Model 2-style web applications in detail:

 

Copyright © 1997, 2004, Oracle. All rights reserved.