Object-Oriented Programming Paradigm
By
Daniel C. Williams
MCIS 611
Instructor: Dr. Frank J. Mitropoulos
Research Report
Graduate School of Computer and Information Sciences
Nova Southeastern University
April 25, 2010
2
Table of Contents
Abstract ............................................................................................................................... 3
Introduction ......................................................................................................................... 4
Review of Literature............................................................................................................ 5
Data and Analysis ............................................................................................................... 7
Data Qualities ................................................................................................................ 7
Object-Oriented Programming Languages ..................................................................... 9
Eiffel ........................................................................................................................... 9
Smalltalk ................................................................................................................... 10
Ruby .......................................................................................................................... 10
Java ........................................................................................................................... 11
C++ ........................................................................................................................... 12
Featured Components ................................................................................................... 13
Encapsulation ........................................................................................................... 13
Polymorphism / Dynamic Binding......................................................................... 13
Inheritance ................................................................................................................ 14
Data Abstraction ...................................................................................................... 14
Conclusion ........................................................................................................................ 15
Bibliography .................................................................................................................... 16
3
Abstract
The purpose of this research report is to investigate a particular programming paradigm
and describe what distinguishes it from the other programming paradigms. Also
described in this report are the details of the various aspects of the chosen paradigm and
describes the specifics in detail. This paper will end with a conclusion and a bibliography
of the resources used to accumulate the date for this report.
4
Introduction
There are a number of programming paradigms out in the field of programming, many of
which offer different characteristics. None of the main programming paradigms have a
precise globally unanimous definition, or any across the board standard that is followed
with writing code for these paradigms.
By definition, a programming paradigm is a functional style of computer programming
which differ in the concepts and abstractions used to represent the elements of a program.
When a software engineer chooses to select a paradigm to use, the selection in my
opinion is based on the best approach to developing software. With that being said,
object-oriented programming paradigm is mostly chose because it offers more
characteristics and flexibility than most of the other paradigms. Object-oriented programs
offer main characteristics such as Objects, Methods, Message-passing, Information
Hiding, Data Abstraction, Encapsulation, Polymorphism and Inheritance.
This research report is intended to focus on object-oriented programming as the selected
programming paradigm.
5
Review of Literature
A paradigm is a term used to describe a set of theories, standards and methods that
together represent a way of organizing knowledge; that is, a way of viewing the world. As
further defined by (Floyd, 1979), a programming paradigm is a way of conceptualizing
what it means to perform computation and how tasks that are to be carried out on a
computer should be structured and organized.
Object-oriented programming is one of the programming paradigms or methodologies
used in the programming language (Pokkunuri, 1989). Most programmers tend to agree
that a program is basically a collection of interacting objects. In today’s world of
computers, most systems come with multiple processors, multiple cores which allows
process-oriented programming programmers to think applications as sets of concurrent
processes acting upon logically shared data structures.
As stated by (Neubauer & Strong, 2002) properties of object-oriented methods frequently
make the claim that the object-oriented programming paradigms is “more natural” than the
procedural programming paradigm because the world we experience is filled with things
(objects) which have both attributes and behaviors. This is easily helps solidify the claim
that the object-oriented programming is more easy to understand and more consistent with
existing patterns of though. As compared to other programming paradigms, object-
oriented programming in my opinion is more widely accepted because of this reason and
what distinguishes object-oriented programming paradigms from the other paradigms.
6
Currently what has distinguishes the object-oriented paradigm from the others is because
of the strong support of encapsulation and the logical grouping of program aspects. These
properties are very important when programs become larger and larger. There are
primarily four main programming paradigms which are described below and why I stated
my claim that object-oriented programming paradigms are more widely accepted:
Imperative paradigms often operate as an order of commands such as, “first do
this and next do that”. This style is similar to that of everyday routines, such as
food recipes and car repair.
Logic paradigms work well when being applied in problem domains that deal
with the extraction of knowledge from basic facts and relations. This paradigm
seems to be less “natural” than the others. This approach is more or less, “Answer
a question via search for a solution”
Functional paradigms are similar to Imperative paradigms, but cleaner. It
operates more on a basis of, “Evaluate an expression and use the resulting value for
something”. This style fits well with computations driven by need.
Object-Oriented paradigms operate by sending messages between objects to
simulate the temporal evolution of a set of real world phenomena. This theory of
concepts, and modules of human-interaction with real world phenomena. Data as
well as operations are encapsulated in objects.
7
I think that most programmers want to write programs more that simulate real world
actions, which is what distinguishes object-oriented paradigms from the others.
Data and Analysis
The goals here are to present the data and analyze the comparisons.
Data Qualities
As there are a number of object-oriented programming languages, some of the more
widely used languages were selected to gather more informational data for the purposes
of this report.
There is widely variable agreement on the factors of what represents the qualities of an
object-oriented language. These qualities are:
1. Encapsulation / Information Hiding
2. Inheritance
3. Polymorphism / Dynamic Binding
4. All pre-defined types are objects
5. All operations performed by sending messages to objects
6. All user-defined types are objects
For the most part, a language is considered to be a “pure” object-oriented language if it is
satisfies all of these qualities. There is another form of object-oriented languages that are
considered to be “hybrid” language, which supports some of the qualities, but not all of
them. The chart below compares a number of languages that are considered to be object-
oriented languages.
8
Programming Languages
Eiffel Smalltalk Ruby Java C++
Encapsulation / Yes Yes Yes Yes Yes
Information Hiding
Inheritance Yes Yes Yes Yes Yes
Polymorphism / Yes Yes Yes Yes Yes
Dynamic Binding
All pre-defined types Yes Yes Yes No No
are objects
All operations are Yes Yes Yes No No
messages to be
objects
All user-defined Yes Yes Yes No No
types are objects
9
Object‐Oriented Programming Languages
Eiffel
Is an object-oriented programming language designed to enable programmers to develop
extensible, reusable, efficiently reliable software. Primarily, Eiffel is being used in
academic programs to teach programming principles.
Much of the fuss about Eiffel according to (Wilder, 1995) is the reuse of code and
software components. Currently software reuse has not been successful in the field.
The reason a lot of programmers like using Eiffel are because it’s:
● Simple and consistent syntax makes Eiffel an easy language to learn.
● It's available on a wide range of platforms.
● It has been placed in the public domain with its published, non-priority design.
which all existing vendors agree to observe.
The Eiffel language offers power, simplicity, strong type checking and numerous
amenities.
10
Smalltalk
Smalltalk is an object-oriented, dynamically typed, reflective programming language that
was created as the language to underpin the “new world” of computing exemplified by
“human-computer symbiosis”. More or less it was designed and created in part for
educational use.
(Foote & Johnson, 1989) States that computational reflection makes it easy to solve
problems that are otherwise difficult to address, however the ability to override method
lookup can bring much of the power of reflection to languages such as Smalltalk-80 at no
cost in efficiency.
Ruby
Ruby is an object-oriented general purpose programming language that combines syntax
inspired by Perl with Smalltalk-like features. The biggest differences with Ruby are that
it is a very flexible programming language because it supports multiple paradigms in
addition to the object-oriented paradigm including functional, imperative and reflective.
It also has a dynamic type system and automatic memory management, which allows it to
be used or many functions.
The designer of this program language Matsumoto states that Ruby was designed for
programmer productivity and fun, following principles of good user interface design. The
system design needs to emphasize human, rather than computer needs.
11
Java
Java is a programming language developed by a developer of Sun Microsystems. The
programming language derives much of its syntax from C and C++ but has a simple
object model and fewer low-level facilities. Java is a widely used programming language
mainly by web developers. When creating Java, the developers stated that there were five
primary goals in the creation of the language:
1. It should be simple, object-oriented and familiar.
2. It should be robust and secure.
3. It should be architecture neutral and portable.
4. It should execute with “high performance”
5. It should be interpreted, threaded and dynamic.
Portability is one of the primary characteristics of Java, which basically means that most
computer programs written in Java programming language must run similarly on any
supported hardware/operating system platform. Java also provides automatic memory-
management.
12
C++
(Henderson & Zorn, 1994) States that object-oriented programming has become widely-
used, important programming paradigm that is supported in many different languages.
The C++ programming language is currently the most widely available and widely used
language in this paradigm and, as such, many programmers are familiar with the object-
oriented paradigms through their experience C++.
A lot of the languages today including the likes of Java are based upon the C++
programming language. C++ is a statically typed, free-form, multi-paradigm, compiled,
general purpose programming language. It comprises of both high-level and low-level
language features.
C++ deliberately differs from languages designed to support a single way of writing
programs. By far C++ is one of the most popular programming languages used today.
13
Featured Components
Below is a list of some of the many featured components that object-oriented
programs have to offer within the paradigm.
Encapsulation
As defined, encapsulation means the representation of an object is for the objects
definition. Each object is more or less like its own entity. The data is kept private to itself
and is hidden from others. What this does is restricts the unwanted effects due to changes
in specifications, design, etc. Hiding the internals of the object protects its integrity by
preventing users from setting the internal data of the component into an invalid or
inconsistent state. Encapsulation reduces system complexity and increase robustness.
Polymorphism / Dynamic Binding
Conventional program languages are usually bound to their respective operations at the
time of compilation. This is considered to be static binding. In terms of object-oriented
programming, dynamic binding means determining the exact implementation of a request
based on both the request operation name and the receiving object at the run-time.
Polymorphism is the ability of one type to appear as another type. This is what is
responsible for the style of programming called message-passing.
14
Inheritance
Inheritance is a way to form new classes using classes that have already been defined.
Basically handles the reuse of existing code with little to no modification. As stated by
(Pokkunuri, 1989) , the addition of new types requires the common routines such as ‘print’
to be rewritten. This is however over covered by means of inheritance.
Data Abstraction
(Cohen, 1984) States the idea behind data abstraction is that of defining a pattern for
objects just as user-defined types define patterns for data structures. Programs should not
make assumptions about implementation and internal representations. Data abstraction
simply extends data encryption and can be viewed as an extended sort of type.
15
Conclusion
In my opinion, object-oriented programming paradigm is a better way of solving problems
in computers as compared to the procedural programming languages such as C. Object-
oriented programming languages are designed around the data being operated upon as
opposed to the operations, these operations are designed to fit data.
One of the principal advantages of object-oriented programming techniques over
Procedural programming techniques are that they enable programmers to create modules
that do not need to be changes when a new type of object is added.
With the ever changing and growing of the number of calculations that the average
processor can produce will take object-oriented programming into the virtual world. Out
of all the paradigms, object-oriented programming better fits our thinking and makes it
easier to visualize our program models. By this, I think that object-oriented programming
will continue to grow into the future without any problems. So even in an entirely new
programming environment, like the 3D virtual worlds that fiction promises us, the object-
oriented programming paradigm may still be appropriate.
16
Bibliography
Cohen, A. T. (1984, January). Data abstraction, data encapsulation and object-oriented
programming. ACM SIGPLAN Notices , 19 (1), pp. 31-35.
Floyd, R. W. (1979, August). The paradigms of Programmins. Communications of the
ACM , 22 (8), pp. 455-460.
Foote, B., & Johnson, R. E. (1989). Reflective facilities in Smalltalk-80. Conference on
Object Oriented Programming Systems Languages and Applications , pp. 327-
335.
Henderson, R., & Zorn, B. (1994, November). A Comparison of Object-oriented
Programming in FourModern Languages. Software-Practice and Experience , 24 (11),
pp. 1077-1095.
Neubauer, B. J., & Strong, D. D. (2002, October). The object-oriented paradigm: more
Natural or Less familiar? Journal of Computing Sciences in Colleges , 18 (1), pp.
280-289.
Pokkunuri, B. P. (1989, November). Object Oriented Programming. ACM SIGPLAN
Notices , pp. 96-101.
Stansifer, R. (1994). The study of programming languages. Dallas, TX: Prentice-Hall,
Inc.
Turban, E., Aronson, J. E., Liang, T.-P., & Sharda, R. (2007). Decision Support and
Business Intelligence Systems. Georgia: Prentice Hall.
Wilder, D. (1995, June). Introduction to Eiffel. Linux Journal , 1995 (14es).