| |
 |
|
Inheritance Structures
Oracle Tips by Burleson Consulting |
High Performance Data Warehousing
Database Architectures For The 1990s
Inheritance
Inheritance is defined as the ability of a lower-level object to
inherit or access the data structures and behaviors associated with
all classes above it in the class hierarchy. Multiple inheritance
refers to the ability of an object to inherit data structures and
behaviors from more than one superclass.
To illustrate, let's look at an application of this system for a
vehicle dealership. Occurrences of items to a dealership are
vehicles; beneath the vehicle class, we may find subclasses for cars
and boats. The car class may be further partitioned into truck, van,
and sedan classes.
The vehicle class would contain the data items unique to vehicles,
including the vehicle ID and the year of manufacture. The car class,
because it IS-A vehicle, would inherit the data items of the vehicle
class. The car class might contain data items, such as the number of
axles and the gross weight of the vehicle. Because the van class
IS-A car, which in turn IS-A vehicle, objects of the van class will
inherit all data structures and behaviors relating to the car and
vehicle classes.
Important facts about Inheritance
It is critical to the understanding of inheritance to note that
inheritance happens at different times during the life of an object.
* Inheritance of data structures--At object creation time,
inheritance is the mechanism whereby the initial data structure for
the object is created. It is critical to note that only data
structures are inherited--never data. It is a common misconception
that data is inherited, such that an order may inherit the data
items for the customer that placed the order. We must understand
that inheritance is only used to create the initial, empty data
structures for the object. In our example, all vehicles would
inherit data definitions in the vehicle class, while an object of a
lower-level class (say, sailboat) would inherit data structures that
only apply to sailboats--as in sail_size.
* Inheritance of methods--Inheritance also happens at runtime when a
call to a method (stored procedure) is made. For example, assume
that the following call is made to sailboat object:
SAILBOAT.compute_rental_charges();
The database will first search for the compute_rental_charges in the
sailboat class; if it is not found, the database will search up the
class hierarchy until compute_rental_charges is located.
This is an excerpt from "High Performance
Data Warehousing", copyright 1997.
 |
If you like Oracle tuning, you may enjoy the book
Oracle Tuning: The Definitive Reference , with over 900 pages of BC's favorite tuning
tips & scripts.
You can buy it directly from the publisher and save 30%, and get
instant access to the code depot of Oracle tuning scripts. |
|