Jimma Institute of Technology: Chapter 1 Introduction To OOP
Jimma Institute of Technology: Chapter 1 Introduction To OOP
10/18/2019 1
Chapter contents
❑ Programming Paradigm and Sorts of Programming
paradigms
❑ Object Oriented Programming
❑ Basic concepts of OOP
❖ Abstraction
❖ Encapsulation
❖ Inheritance
❖ Polymorphism
❖ Data Hiding
❖ Reusability
❖ Extensibility
10/18/2019 2
Programming paradigms
10/18/2019 3
Programming paradigms…
❖ Some paradigms are concerned mainly with
implications for the execution model of the language,
such as the sequence of operations is defined by the
execution model.
10/18/2019 5
Programming paradigms…
❖ Currently, there are different sorts of programming
paradigms and the following are some common
Paradigms:
➢ unstructured programming
➢ Structured programming
➢ Modular programming
➢ Logic programming
➢ Procedural programming
10/18/2019 8
Programming paradigms…
❖ Modular programming: is a programming paradigm that
emphasizes separating the functionality of a program into
independent and interchangeable modules or subunits.
10/18/2019 9
Programming paradigms…
❖Procedural Programming: is uses a linear or
top-down approach. It relies on procedures or
subroutines to perform computations.
Fig. a) physical structure of procedural programming Fig. b) Depicts the execution process of procedural programming
10/18/2019 10
Programming paradigms…
❖ Logic Programming: a sort of programming which
largely based on formal logic (rules and facts).
➢PROLOG(Program Logic),
➢Datalog … etc
10/18/2019 11
Programming paradigms…
Example for logic code sentences:
➢ Rule1: If the food is delicious AND services is
excellent, then the tip is high.
10/18/2019 12
Procedural Vs OOP Paradigm
Procedural Programing
Object Oriented Programming
➢ Emphasis on procedures
❖ Emphasis on object creation
(It is step wise)
data abstraction
➢ Provides less secure
❖ Provides more secure
➢ Difficult to add a new
❖ Easy to add new data and
data and function
function
➢ Follows top-down design
❖ Follows bottom – up design
approach
approach
➢ Example: FORTRAN,COBOL
❖ Example :C++, C#, PHP,Visual
,C, ALGOL..etc
Basic, Java…etc
10/18/2019 13
Introduction to Object Oriented
Programming (OOP)
Object Oriented Programming is one paradigm of
programming, and this programming paradigm is
fundamentally focused on object to design a real
world object into computer programs to solve a given
particular problem. Which means that, Object
oriented programming is a way of organizing
programs as systematic collection of objects, each of
which represents an instance of a class.
10/18/2019 14
Introduction to Object
Oriented Programming(OOP) …
10/18/2019 15
Example: If we consider a student as an object, it is possible to mention the following possible
states and behaviors:
10/18/2019 16
Basic Concepts in OOP
❑ Object oriented programming paradigm model has
its own specific features and these features used to
distinguish it from other programming paradigms.
The basic features or concepts are:
❖ Abstraction
❖ Encapsulation
❖ Inheritance
❖ Polymorphism
❖ Data Hiding
❖ Reusability
10/18/2019 ❖ Extensibility 17
Basic Concepts in OOP …
❖ Abstraction:- is a process of showing only relevant data
and hiding unnecessary details of an object from the
user.
➢ Example1: When you login to your e-mail account as user, you enter
your user_id, password and press login, what happens when you press
login, how the input data sent to e-mail server, how it gets verified is
all abstracted away from you.
➢ Example2: A car in itself is a well-defined object, which is composed
of several other smaller objects like a gearing system, steering
mechanism, engine, which are again have their own subsystems from
the chief Mechanic Perspective. But from the drivers point of view,
car is one single object, which can be managed by the help of its
subsystems, even if their inner details are unknown.
10/18/2019 18
Basic Concepts in OOP…
❖ Encapsulation:- A process of binding and wrapping both
the data and methods for the purpose of protection. So
that, it keeps the entire program safe from external
interference and illegal modification.
10/18/2019 19
Basic Concepts in OOP…
❑Encapsulated code should have the following
characteristics:
10/18/2019 20
Basic Concepts in OOP…
❖ Inheritance:- is a mechanism by which an object
acquires certain or all properties of another object.
In doing so, It supports the concept of hierarchical
classification between objects. In OOP paradigm,
the concept of Inheritance applied through Creating
a new class from the existing old class and
inheriting commonly used states and behaviors
from the parent class.
10/18/2019 21
Basic Concepts in OOP…
❖ Polymorphism:- is a technique to process an object
differently based on its data type. which means
that, it allows us to perform a single action method
in different ways. This can be achieved through
method overloading and overriding.
❖ Data Hiding:- is protection mechanism of the
object's data from outsiders object access within
the program. It Implements through
authentication and validation process.
Example: Facebook or e-mail account.
10/18/2019 22
Basic Concepts in OOP…
❖ Reusability:- is a means of reusing formerly developed
program for an other related purpose or project.
10/18/2019 23
END of ch-1
THANK YOU!!!
10/18/2019 24