OBJECT-ORIENTED PROGRAMMING
PARADIGMS
The
object-oriented approach to programming is an easy way to master the management
and complexity in developing software systems that take advantage of the
strengths of data abstraction. Data-driven methods of programming provide a
disciplined approach to the problems of data abstraction, resulting in the development
of object-based languages that support only data abstraction. These
object-based languages do not support the features of the object-oriented paradigm,
such as inheritance or polymorphism. Depending on the object features
supported, there are two categories of object languages:
1.
Object-Based Programming Languages
2.
Object-Oriented Programming Languages
Object-based
programming languages support encapsulation and object identity (unique
property
to
differentiate it from other objects) without supporting important features of
OOP languages such as polymorphism, inheritance, and message based
communication, although these features may be emulated to some extent. Ada, C,
and Haskell are three examples of typical object-based programming languages.
Object-based
language = Encapsulation + Object Identity
Object-oriented
languages incorporate all the features of object-based programming languages, along
with inheritance and polymorphism (discussed later in this chapter). Therefore,
an object-oriented programming language is defined by the following statement:
Object-oriented
language = Object-based features + Inheritance + Polymorphism
Object-oriented
programming languages for projects of any size use modules to represent
the physical building blocks of these languages. A module is a logical grouping
of related declarations, such as objects or procedures, and replaces the
traditional concept of subprograms that existed in earlier languages.
The following are important features in
object-oriented programming and design:
1. Improvement over the structured programming
paradigm.
2.
Emphasis on data rather than algorithms.
3.
Procedural abstraction is complemented by data abstraction.
4.
Data and associated operations are unified, grouping objects with common
attributes, operations, and semantics. Programs are designed around the data on
which it is being operated, rather than the operations themselves. Decomposition,
rather than being algorithmic, is data-centric. Clear understanding of classes and
objects are essential for learning object-oriented development. The concepts of
classes and objects help in the understanding of object model and realizing its
importance in solving complex problems. Object-oriented technology is built
upon object models. An Object is anything having crisply defined conceptual
boundaries. Book, pen, train, employee, student, machine, etc., are examples of
objects. But the entities that do not have crisply defined boundaries are not
objects. Beauty, river, sky, etc., are not objects.
Model
is the description of a specific view of a real-world problem domain showing
those aspects, which are considered to be important to the observer (user) of
the problem domain. Object-oriented programming language directly influences
the way in which we view the world. It uses the programming paradigm to address
the problems in everyday life. It addresses the solution closer to the problem
domain.
Object
model is defined by means of classes and objects. The development of
programs using object model is known as object-oriented development. To learn
object-oriented programming concepts, it is very important to view the problem
from the user’s perspective and model the solution using object model.
No comments:
Post a Comment