Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 19

Evolution of various

programming paradigms
• When computers are invented, the binary language was used
to write the programs. However, as the programs grew in size,
it became difficult to write programs using binary language.
• Then assembly language was invented to write large programs
which was also not user-friendly.
• With the changes in the user requirements, the size and the
complexity of the programs continued to grow, which led to
the development of high-level languages such as BASIC and
FORTRAN.
• However , these languages provided an unstructured way of
writing programs. i.e., all the instructions of a program were
written one after the other in a single function and hence, was
suitable for writing only small and simple programs.
• For large and complex programs , it became difficult to trace
and debug errors
• To overcome the limitations of unstructured programming
paradigm, other programming paradigms such as procedural,
modular, object-oriented, etc. were developed.

• Overview of procedural programming paradigm


• In late 1960s, the high-level languages such as C and Pascal
were developed, which provided a structured way of writing
programs.
• Structured programming(also known as procedural
programming) was a powerful and an easy approach of writing
complex programs.
• This approach follows the top-down approach for designing
the program. i.e., first the entire program is divided into a
number of subroutines and these subroutines are again divided
into small subroutines and so on until each subroutine
becomes an indivisible unit.
Top-down approach
Main Program

Subroutine-1 Subroutine-2 Subroutine-3 Subroutine-4

Subroutine-5 Subroutine-6 Subroutine-7

Subroutine-8 Subroutine-9
• Even though procedural programming paradigm is a simple
and easy task. There are some limitations also.
• The procedural programming approach does not represent
real-world models very well.
• In procedural approach the data and the associated functions
are loosely related.
• The large programs developed using this approach are difficult
to maintain, debug and extend.
Object –Oriented Programming Paradigm
• To overcome the limitations of procedural programming, object-
oriented programming paradigm has been developed which has
revolutionized the process of software development.

• It includes the best features of structured programming but also


some new and powerful features.

• object-oriented programming, the programmers define not only


the data, but also the operations(functions) that can be performed
on it together under a single unit and thus, creating different kinds
of variables known as objects.

• An object is a unit of structural and behavioral modularity that


contains a set of properties (or data) as well as the associated
functions.
Important Characteristics of Object-oriented
Programming
• Object-oriented programming language is a feature that allows a
mode of modularizing programs by forming separated memory
area for data as well as functions that is used as object for making
copies of modules as per requirement.

• OOP pays more importance to data than to function.


• Programs are divided into classes and their member functions
• New data items and functions can be comfortable added
whenever essential.
• Data is private and prevented from accessing external functions.
• Objects can communicate with each other through functions.
Key concepts of Object-oriented programming
• There are several fundamental or key concepts in object-oriented
programming.
1 Objects:
• Objects are primary run-time entities in an object-oriented
programming.
• Every object consists of a state and behaviour. (its own
properties and features)
• The state of an object is one of the possible conditions that an
object can exist in and is represented by its characteristics or
attributes or data.
• The behaviour of an object determines how an object acts or
behaves and is represented by the operations that it can perform.
• In Oop, the attributes of an object are represented by the
variables and the operations are represented by the functions.
2 classes: (user-defined data type)
• A class is defined as a user-defined data type.
• A class is grouping of objects having identical properties,
common behavior, and shared relationship.
• Objects are nothing but variables of type class.
• Once a class has been declared, the programmer can create a
number of objects associated with that class.
• The syntax used to create an object is similar to the syntax
used to create an integer variable in C.
3 Method:
– An operation required for an object or entity when coded in a
class is called a method.
– The operations that are required for an object are to be defined
in a class.
– All objects in a class perform certain common actions or
operations.
4 Abstraction:
– Hiding of irrelevant details and representing only the essential
features
– Two types:
– Data abstraction: hiding the details about the data
– Control abstraction : hiding the implementation details
– Since, the internal details of the class are hidden from the
outside world, thus, data abstraction ensures security of data
by preventing it from accidental changes or manipulations by
other parts of the program.
5 Encapsulation:
• The technique of binding or keeping together the data and the
functions in a single unit
• Encapsulation is the way to implement data abstraction.
• The data is not accessible by outside functions, only those
functions that are able to access the data are defined within the
class.
• The hidden data of a class cannot be accessed directly by the
outside world. However, the member functions of the class act
as a medium to access the hidden data.
• This process of preventing the data from the direct access by
the external functions is called data hiding.
6 Inheritance:
• inheritance is the method by which objects of one class get
the properties of objects of another class.
• The class, which is inherited by the other classes, is known
as superclass or base class or parent class
and the class, which inherits the properties of the base class,
is called sub class or derived class or child class.
• The sub class can further be inherited to form other derived
classes.
• Eg: Red Yellow Blue

Orange Green Violet

Reddish Yellowish Bluish


Brown brown brown
• In the above figure, Red , Yellow and blue are the main colors,
Orange color is created from the combination of red and
yellow, green is created from yellow and blue, and violet is
created from red and blue. Orange color has attributes of both
red and yellow, which produces a new effect. Thus, many
combinations are possible
7 Polymorphism:
• Polymorphism allows the same function to act differently in
different classes.
• it is an important feature of OOP concept and has the ability
to take more than one form.
• Different ways of implementing Polymorphism

Polymorphism

Compile-time Run-time

Virtual
Operator Function functions
Overloading overloading
8 Dynamic Binding:
• Dynamic binding is the process of linking of a function call
to the actual code of the function at run-time.
• That is, in dynamic binding, the actual code to be executed is
not known to the compiler until run-time.

geometrical_shape
area()

square rectangle circle


area() area() area()
{ { {
implementation implementation implementation
} } }

Run time polymorphism


9) Message Passing:
• Message passing is a process of interacting between different
objects in a program.
• In object-oriented paradigm , when the program is executed,
these objects interact or communicate with each other by
sending and receiving messages.
• The messages are exchanged by calling the member functions
of the classes.

Object . Display (argument);

Object
Message Data
Message
Communication passing
Operator
Applications of OOP
• Object–oriented paradigm has touched many major application
areas of software development.
• Some of the application areas where oop has been used to
develop software are listed here.
1) Simulations and Modeling :Simulation is the technique of
representing the real world entities with the help of a
computer program.
• Simula-67 and Smalltalk are two object-oriented languages
are designed for making simulations.

2) User-interface design: Another popular application of OOP


has been in the area of designing graphical user interfaces
such as Windows.
3) Developing computer games : OOP is also used for
developing computer games such as Diablo, Startcraft and
Warcraft III.
• These games offer virtual reality environments in which a
number of objects interact with each other in complex ways
to give the desired result.
4) Scripting: In recent years, OOP has also been used for
developing HTML, XHTML and XML documents for the
internet.
• Python, Ruby and Java are the scripting languages based on
object-oriented principles which are used for scripting
5) Object Databases: OOP concepts have also been used to
develop a new DBMS named object databases.
These databases are not as popular as the traditional RDBMS
• Some other areas of applications include office automation
systems, decision support systems, Artificial Intelligence and
expert systems, Neural networks and parallel programming,
and computer-Aided Design(CAD) Systems

You might also like