Database Reference
In-Depth Information
First, some OO definitions:
Class : In object technology, a user-defined data type that defines a col-
lection of objects that share the same characteristics. An object,
or class member, is one instance of the class. Concrete classes are
designed to be instantiated. Abstract classes are designed to pass on
characteristics through inheritance.
Object : A self-contained module of data and its associated processing.
Objects are the software building blocks of object technology.
Polymorphism : Meaning many shapes. In object technology, the ability
of a generalized request (message) to produce different results based
on the object that it is sent to.
Inheritance : In object technology, the ability of one class of objects to
inherit properties from a higher class.
Encapsulation : In object technology, making the data and process-
ing (methods) within the object private, which allows the internal
implementation of the object to be modified without requiring any
change to the application that uses it. This is also known as informa-
tion hiding .
Take another look at Figure 7.7. Here we have a class called automobile .
This class has several attributes in common. One is that this thing has a
motor. Another attribute is the fact that an automobile (usually) has four
wheels. In an OO system, you can create derived classes from the parent
class. Notice the nice, shiny red sports car. This is the derived class called
sports car . It also has a motor and four wheels that it inherits from the par-
ent class. But in this derived class we have some additional attributes: fast
rpm, and sleek design. The sports car is the child of the parent class named
automobile . So we can say “every convertible is an automobile” but not
“every automobile is a convertible.”
To develop an OO application, one must define classes. If you know
anything about OO programming languages such as C++, all variables
within a program are defined as some type of data. For example, in C
and C++, a number is defined as a type called integer . When we define
a class in a programming language, it is defined as a type of class, as
shown here:
Search WWH ::




Custom Search