Database Reference
In-Depth Information
Encapsulation. This means that you can place the important aspects within the def-
inition of an object as in a capsule. An object, therefore, contains both the data struc-
ture and the set of operations that can manipulate it.
Information hiding. With abstraction, you can separate the external aspects of
implementation from the inner details. The inner aspects of what the object is and
what it does may be hidden from the external realm.
What are the effects of encapsulation and information hiding on application
processing? The internal details are insulated from the external implementation and
processing requirements. Therefore, you may change the internal representation
and the definition of internal operations without affecting processing requirements.
An object resembles a black box component that can be constructed and changed,
apart from the rest of the system. Such modularization simplifies the design and
development of applications.
In object orientation, abstract data types (ADTs) provide encapsulation. An
object has an interface part and an internal or implementation part. Only the
interface part is made visible to users and programs.
Inheritance Through inheritance an object may inherit the internal compo-
nents from an entity at a higher level. For example, an object known as SalesPerson
can inherit the structure representation as well as definitions of internal opera-
tions or behavior from an object called EMPLOYEE at a higher level. Even at
this stage you can readily appreciate how the property of inheritance results in
code sharing and structure sharing. We will cover inheritance in more depth a little
later.
Object Identity The identity of an object distinguishes that single object from all
other objects. Using an object identity, you can differentiate one object from another
through its attributes. The notion of object identity enables one object to refer to
another object or one object to contain another object. Figure 20-1 illustrates the
use of object identity as applied to an airplane and its component parts.
Airplane
Engine
Body
Wing
Movement
Control
Propulsion
Cabin
Overhead
Bin
Rudder
Aileron
Propeller
Seat
Figure 20-1
Identities for airplane identity.
Search WWH ::




Custom Search