Oracle9i OLAP Developer's Guide to the OLAP API Release 2 (9.2) Part Number A95297-01 |
|
Introduction to the OLAP API, 6 of 6
An application that uses the OLAP API typically performs the following tasks:
The rest of this topic briefly describes these tasks, and the rest of this guide provides detailed information.
An application connects to the data store by identifying some information about the target Oracle database and specifying this information in a JDBC connection method.
For more information about connecting, see Chapter 3, "Connecting to a Data Store".
Having established a connection, the application creates an MdmMetadataProvider
. This object gives access to all the metadata objects in the data store.
To discover the available metadata, an application uses the getRootSchema
method on the MdmMetdataProvider
to obtain the top-level measure folder for all of its metadata objects. The application then gets the dimensions, measures, and subfolders that are under the root. Once the application has all the dimensions and measures, it can interrogate them to get their attributes, hierarchies, levels, and other characteristics.
Having determined the metadata objects that it has to work with, the application can present relevant lists of objects to the user for data selection and manipulation.
For a description of the metadata objects, see Chapter 2, "Understanding OLAP API Metadata". For information about how an application can discover the available metadata, see Chapter 4, "Discovering the Available Metadata".
The heart of any OLAP application lies in the construction of queries against the data store. The application user interface provides ways for the user to select data and specify what should be done with it. Then, the data manipulation code translates these instructions into queries against the data store. The queries can be as simple as a selection of dimension elements, or they can be complex, including several aggregations and calculations on measure values.
The OLAP API object that specifies a query is a Source
. Therefore, a significant portion of any OLAP API application is devoted to dealing with Source
objects.
You can manipulate Source
objects directly, using methods such as select
, remove
, and appendValues
to create selections. In addition, you can use methods such as plus
, div
, and total
to calculate values. Source
and its subclasses, NumberSource
, StringSource
, and BooleanSource
, have a rich assortment of methods for manipulating data. The most powerful method in Source
is join
, which gives you the ability to combine Source
objects in almost any way imaginable.
If you are implementing a simple user interface, you might use only the methods on the Source
classes to select and manipulate the data that users specify in the interface. However, if you want to offer your users multistep selection procedures and the ability to modify queries or undo individual steps in their selections, you should use Template
classes as described in the topic "Developing an OLAP API Application" . Within the code for each Template
, you use the methods on the Source
classes, but the Template
classes themselves allow you to modify and refine even the most complex query. In addition, you can minimize your work by writing general-purpose Template
classes and reusing them in various parts of your application.
For information about working with Source
objects, see Chapter 5, "Introduction to Querying". For information about working with Template
objects, see Chapter 10, "Creating Dynamic Queries".
When users of an OLAP application are selecting, calculating, combining, and generally manipulating data, they also want to see the results of their work. This means that the application must retrieve the result sets of queries from the data store and display the data in multidimensional form. To retrieve a result set for a query through the OLAP API, the application creates a Cursor
based on the Source
that specifies the query.
Because the OLAP API was designed to deal with a multidimensional view of data, a Source
can have a multidimensional result set. For example, a Source
can represent an MdmMeasure
that is structured by three MdmDimension
objects. The Cursor
for this Source
has a structure that mirrors the Source
itself; that is, the Cursor
organization is based on the same three MdmDimension
objects.
To retrieve all the items of data through a Cursor
, the application can loop through the multidimensional Cursor
structure. This design is well adapted to the requirements of standard user interface objects for painting the computer screen. It is especially well adapted to the display of data in multidimensional format.
For more information about using Cursor
objects to retrieve data, see Chapter 8, "Understanding Cursor Classes and Concepts".
|
Copyright © 2000, 2002 Oracle Corporation. All Rights Reserved. |
|