About Oracle ADF View Objects

Oracle ADF view objects are business components that collect data from the datasource, shape that data for use by clients, and allow clients to change that data in the Oracle ADF Business Components cache. For example, a view object can gather all the information needed to:

To define a view object, see Creating a View Object Definition.

View Objects and Datasources

View objects must have a mechanism for retrieving data from the datasource. In the vast majority of cases, the datasource is a database, and the mechanism is a SQL query. Oracle ADF Business Components can automatically use JDBC to pass this query to the database and receive the result.

When view objects use a SQL query, query columns map to view object attributes in the view object. The definitions of these attributes (reflected in the view object's XML file, as described below) reflect the properties of these columns, including data types and precision and scale specifications. When view objects use other datasources, view object attributes map to "columns" of data from those datasources, as defined by the programmer. For more information about view object attributes, see the related topics list.

View Objects and Clients

Because view objects are data model components, you should consider your client's data needs when defining them. Ask yourself the following questions before designing a view object:

This will allow you to design your view object efficiently, without retrieving and storing more data than necessary and without having to programmatically assemble data for your client.

View objects can also contain service methods--methods that perform complex operations on data. These methods can be called from clients, requiring very little data manipulation processing in the client itself. For more information, see the realted topics list.

View Object Definitions and View Object Instances

Often, it is important to distinguish between the following:

You create a view object definition using JDeveloper's tools. Instances of that view object can then be added to application module definitions and accessed and customized later by clients. For more information, see the related topics list.

Entity Usages in View Object Definitions

When you use the database as your datasource, view object attributes correspond to query columns, which often correspond to table columns. Similarly, in the non-database case, view object attributes will often correspond to "columns" of datasource objects. Because of this, view object attributes often correspond to entity object attributes.

You can formalize this connection by adding one or more entity usages to a view object definition. You can then map some or all of the view object's attributes to entity object attributes. The values of the attributes are then stored in a cache managed by the entity object, not caches managed by the view object instances. This allows you to make changes to the database using the view object and can have substantial effects on performance. For more information, see the related topics list.

View Objects, XML Files, and Java Classes

Like most business components, individual view objects are partially defined by XML files. These files specify simple metadata, such as the query that retrieve's the view objects data, the view object attributes, and entity object usages (see below).

If an XML file satisfies your needs for a particular view object, you may not need to extend any classes or write any Java code.

In addition to XML files, view objects are defined by up to two Java classes:

For more information, see the related topics list.

About Business Components
About Oracle ADF Business Domain Components, Data Model Components, and Organizational Components
About Oracle ADF Business Components Cache Management
About View Object and View Link Instances
About View Object Attributes
About View Object Java Classes
Representing a Query
About Oracle ADF Entity Objects
About Oracle ADF View Links
About Business Components Service Methods
About Oracle ADF Application Modules


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