In this session you will learn about
- Introduction of Languages
- Difference between POP and OOP
- What is OOP?
- Object-Oriented Programming
- Advantages of OOP
- Object-Oriented Programming Paradigm
- Features of OOP
- Applications of Object Oriented Programming
- Benefits of Object Oriented Programming
2. ā¬„ Introduction of Languages
ā¬„ Difference between POP and OOP
ā¬„ What is OOP?
ā¬„ Object-Oriented Programming
ā¬„ Advantages of OOP
ā¬„ Object-Oriented Programming Paradigm
ā¬„ Features of OOP
ā¬„ Applications of Object Oriented Programming
ā¬„ Benefits of Object Oriented Programming
3. INTRODUCTION
ā¬„ Programmers write instructions in various programming
languages to perform their computation tasks such as:
1. Machine level Language
2. Assembly level Language
3. High level Language
4. Machine level Language :
ā¬„ Machine language is a set of instructions executed directly by a computer's
central processing unit (CPU).
ā¬„ Each instruction performs a very specific task, such as a load, a jump, or an
ALU operation on a unit of data in a CPU register or memory.
ā¬„ Every program directly executed by a CPU is made up of a series of such
instructions.
o An assembly language (or assembler language) is a low-level programming
language for a computer, or other programmable device, in which there is a
very strong (generally one-to-one) correspondence between the language and
the architecture's machine code instructions.
o Assembly language is converted into executable machine code by a utility
program referred to as an assembler; the conversion process is referred to as
assembly, or assembling the code.
Assembly level Language :
5. High level Language :
ā¬„ A high-level language is a programming language designed to simplify
computer programming.
ā¬„ High-level language has a higher level of abstraction from the computer, and
focuses more on the programming logic rather than the underlying hardware
components such as memory addressing and register utilization.
ā¬„ The first high-level programming languages were designed in the 1950s.
ā¬„ Now there are dozens of different languages, including Ada, Algol, BASIC,
COBOL, C, C++, JAVA, FORTRAN, LISP, Pascal, and Prolog.
ā¬„ Such languages are considered high-level because they are closer to human
languages and farther from machine languages.
ā¬„ In contrast, assembly languages are considered low-level because they are very
close to machine languages.
ā¬„ The high-level programming languages are broadly categorized in to two
categories:
1. Procedure oriented programming(POP) language.
2. Object oriented programming(OOP) language.
6. Procedure Oriented Programming Language :
ā¬„ In the procedure oriented approach, the problem is viewed as sequence of
things to be done such as reading , calculation and printing.
ā¬„ Procedure oriented programming basically consist of writing a list of
instruction for the computer to follow and organizing these instruction
into groups known as functions.
The disadvantage of the procedure oriented programming languages is:
1. Global data access
2. It does not model real word problem very well
3. No data hiding
7. Object Oriented Programming Language :
ā¬„ Object-oriented programming (OOP) is a computer programming model that
organizes software design around data, or objects, rather than functions and
logic.
ā¬„ An object can be defined as a data field that has unique attributes and
behavior.
8. Difference Between Procedure Oriented Programming (POP) &
Object Oriented Programming (OOP)
Procedure Oriented Programming Object Oriented Programming
1 program is divided into small parts called functions. program is divided into parts called objects.
2 Importance is not given to data but to functions as well as
sequence of actions to be done.
Importance is given to the data rather than procedures or
functions because it works as a real world.
3 follows Top Down approach. OOP follows Bottom Up approach.
4 It does not have any access specifier. Data can move freely from
function to function in the system.
OOP has access specifiers named Public, Private,
Protected, etc.
5 Data can move freely from function to function in the system. objects can move and communicate with each other
through member functions.
6 To add new data and function in POP is not so easy. OOP provides an easy way to add new data and function.
7 Most function uses Global data for sharing that can be accessed
freely from function to function in the system.
In OOP, data can not move easily function to function, it can be
kept public or private so we can control the access of data.
8 It does not have any proper way for hiding data so it is less secure. OOP provides Data Hiding so provides more security
9 Overloading is not possible. In OOP, overloading is possible in the form of
Function Overloading and Operator Overloading.
10 Example : C, VB, FORTRAN, Pascal Example : C++, JAVA, VB.NET, C#.NET.
9. What is OOP?
ā¬„ OOP stands for Object-Oriented Programming.
ā¬„ Procedural programming is about writing procedures or
functions that perform operations on the data, while object-
oriented programming is about creating objects that contain
both data and functions.
10. Object-Oriented Programming
ā¬„ Object-oriented programming (OOP) is a programming paradigm based upon
objects (having both data and methods) that aims to incorporate the
advantages of modularity and reusability.
ā¬„ The important features of objectāoriented programming are ā
ļ¶ Bottomāup approach in program design
ļ¶ Programs organized around objects, grouped in classes
ļ¶ Focus on data with methods to operate upon objectās data
ļ¶ Interaction between objects through functions
ļ¶ Reusability of design through creation of new classes by adding features
to existing classes
11. Advantages
ā¬„ Object-oriented Programming has several advantages over
procedural programming:
ā¬„ OOP is faster and easier to execute
ā¬„ OOP provides a clear structure for the programs
ā¬„ OOP helps to keep the C++ code DRY "Don't Repeat Yourself", and
makes the code easier to maintain, modify and debug
ā¬„ OOP makes it possible to create full reusable applications with less
code and shorter development time
12. ā¬„ OOP treats data as a critical element in the program development
and does not allow it to flow freely around the systems.
ā¬„ It ties data more closely to the functions that operate on it, and
protects it from accidental modification from outside functions.
ā¬„ OOP allows decomposition of a problem into a number of entities
called objects and then builds data and functions around these
objects.
ā¬„ The data of an object can be accessed only by the function
associated with that object.
13. āļ¼Emphasis is on data rather than procedure.
ļ¼Programs are divided into what are known as objects.
ļ¼Data structures are designed such that they characterize the objects.
ļ¼Data is hidden and cannot be accessed by external functions.
ļ¼Objects may communicate with each other through functions.
ļ¼New data and functions can be easily added whenever necessary.
ļ¼Follows bottom-up approch in program design.
Features of object-oriented programming
14. Main application areas of OOP are:
ļ±User interface design such as windows, menu.
ļ±Real Time Systems
ļ±Simulation and Modeling
ļ±Object oriented databases
ļ±AI and Expert System
ļ±Neural Networks and parallel programming
ļ±Decision support and office automation systems etc.
Applications of Object Oriented Programming
15. ļ¶It is easy to model a real system as real objects are represented by programming objects in OOP.
ļ¶With the help of inheritance, we can reuse the existing class to derive a new class such that the
redundant code is eliminated and the use of existing class is extended. This saves time and cost of
program
ļ¶In OOP, data can be made private to a class such that only member functions of the class can access
the data.
ļ¶With the help of polymorphism, the same function or same operator can be used for different
purposes. This helps to manage software complexity easily.
ļ¶Large problems can be reduced to smaller and more manageable problems. It is easy to partition the
work in a project based on objects.
ļ¶It is possible to have multiple instances of an object to co-exist without any interference i.e. each
object has its own separate member data and function.
16. ā¬„ Introduction of Languages
ā¬„ Difference between POP and OOP
ā¬„ What is OOP?
ā¬„ Object-Oriented Programming
ā¬„ Advantages of OOP
ā¬„ Object-Oriented Programming Paradigm
ā¬„ Features of OOP
ā¬„ Applications of Object Oriented Programming
ā¬„ Benefits of Object Oriented Programming