0% found this document useful (0 votes)
28 views

OOP Week1 Class1

The document provides an overview of object-oriented programming including its historical evolution, key concepts like encapsulation, polymorphism and inheritance, benefits of OOP, and differences between procedural and object-oriented programming. Example programming languages that use OOP principles are also listed.

Uploaded by

fahim faisal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

OOP Week1 Class1

The document provides an overview of object-oriented programming including its historical evolution, key concepts like encapsulation, polymorphism and inheritance, benefits of OOP, and differences between procedural and object-oriented programming. Example programming languages that use OOP principles are also listed.

Uploaded by

fahim faisal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Object-Oriented

Programming
Week 1 - Class 1

Presented By
Md. Fahim Faisal
Lecturer, Dept. of CSE, AMUST
Historical Evolution of Programming
• Early programming methods: toggling switches on computer panels.

• Introduction of assembly language for longer programs.

• Emergence of high-level languages like FORTRAN in the 1950s.

• Structured programming languages (Algol, Pascal) in the 1960s.


Historical Evolution of Programming

• Switches for manual input on a Data General Nova 3, manufactured in the mid-1970s
• 16-bit mini computer
Image src: Wikipedia IBM System/360 Front Panel (youtube.com)
Introduction to Object-Oriented Programming
• Need for a new programming approach.

• Invention of Object-Oriented Programming (OOP).

• Advantages of OOP over structured programming.


Features of Structured Programming
• well-defined control structures, code blocks

• the absence (or at least minimal use) of the GOTO

• and stand-alone subroutines that support recursion and local


variables.
What is OO Programming?
• Object-oriented programming (OOP) is a programming paradigm
based on the concept of objects, which can contain data and code
together.

• Data in the form of fields (often known as attributes or properties),


and code in the form of procedures (often known as methods).

• In OOP, computer programs are designed by making them out of


objects that interact with one another.
Principles(or features) of OOP
1. Encapsulation
2. Data abstraction
3. Polymorphism
4. Inheritance
5. Dynamic binding
6. Message passing
Principles(or features) of OOP
1. Encapsulation
2. Polymorphism
3. Inheritance
Encapsulation
• Definition: Wrapping of data and functions together as a single unit is
known as encapsulation.

• Public and private elements within an object.

• Object as a variable of a user-defined type

• Prevention of data direct access by the program is called data hiding


or information hiding

• Provides security
Polymorphism
• Greek words “poly” and “morphism”.

• “poly” means many and “morphism” means form i.e.. many forms.

• "One interface, multiple methods" concept.

• Function overloading and operator overloading in C++.

• Handling greater complexity through standard interfaces


Inheritance
• Definition: Inheritance allows one object to acquire properties of
another.

• Importance of inheritance in organizing information.

• helps realize the goal of constructing software from reusable parts,


Benefits of object oriented programming (OOP)
• Reusability: In OOP’ s programs functions and modules that are written by
a user can be reused by other users without any modification.

• Inheritance: Through this we can eliminate redundant code and extend the
use of existing classes.

• Data Hiding: The programmer can hide the data and functions in a class
from other classes. It helps the programmer to build the secure programs.

• Reduced complexity of a problem: The given problem can be viewed as a


collection of different objects. The problem is solved by interfacing the
objects. This technique reduces the complexity of the program design.
Benefits of object oriented programming (OOP)
• Easy to Maintain and Upgrade:

• Message Passing: : The technique of message communication


between objects makes the interface with external systems easier.

• Modifiability: it is easy to make minor changes, Changes inside a class


do not affect any other part of a program, since the only public
interface that the external world has to a class is through the use of
methods.
Difference Between POP & Object Oriented Programming OOP

Procedure Oriented Programming Object Oriented Programming


(POP) (OOP)
program is divided into small parts called functions. program is divided into parts called objects.
1
Importance is not given to data but to functions as well as Importance is given to the data rather than procedures
2 sequence of actions to be done. or functions because it works as a real world.

follows Top Down approach. OOP follows Bottom Up approach.


2
does not have any access specifier. OOP has access specifiers named
3 Public, Private, Protected, etc.

To add new data and function in POP is not so easy. OOP provides an easy way to add new data and function.
4
Difference Between POP & Object Oriented Programming OOP

Procedure Oriented Programming Object Oriented Programming


(POP) (OOP)
It is less secure. OOP provides security via data hiding
5
Overloading is not possible. overloading is possible
6
Programming are : C, VB, FORTRAN, C++, JAVA, VB.NET, C#.NET.
7
Recommended Text Books
• Teach Yourself C++, Herbert • The complete reference Java,
Schildt Herbert Schildt

Images taken from books.google.com


Recommended Links
• C++ Language Tutorial www.cplusplus.com

• C++ Tutorial from www.learncpp.com

• C++ Tutorial from www.cprogramming.com

• Java Tutorial from http://docs.oracle.com/javase/tutorial/


Google Classroom Code
• k6hbuu6

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy