Download - Presentation c
![Page 1: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/1.jpg)
Presented by :• Kunal N. Sharma
• Shyam D. Hathaliya
Presentation on POP vs OOP
![Page 2: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/2.jpg)
Outline:•Procedure oriented programming language.
•Introduction to pop
•Characteristics
•Advantages
•Disadvantages
•Object Oriented programming language.•Introduction to OOP
•Concepts of OOP
•Advantages
•Disadvantages
•Difference between OOP vs. POP.
![Page 3: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/3.jpg)
![Page 4: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/4.jpg)
What is procedural oriented programming?
•computer programming language that specifies a series of well-
structured steps and procedures within its programming context to
compose a program.
•It contains a systematic order of statements, functions and
commands to complete a computational task or program.
• In the procedure oriented approach, the problem is viewed as
a sequence of things to be done such as reading, calculating and
printing.
![Page 5: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/5.jpg)
Some characteristics of Procedure Oriented
Programming:
•Large programs are divided into smaller programs known
as functions.
•Most of the functions share
global data.
•Data can easily flow from
one function to another.
•Functions transform data from one form to another.
•Employs top-down approach in program design.
![Page 6: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/6.jpg)
Advantages of procedural oriented programming:
•Allows quick completion. It is faster than oop.
•It is good for general purpose programming.
•It has portable source code-use different compiler to target
Different CPUs.
•Large reference is available on well-tired tested algorithms
No need to reinvent the wheel.
•Requires less memory space.
![Page 7: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/7.jpg)
Disadvantages of procedural oriented programming:
•It is difficult to relate with the real world objects.
•The codes are difficult to maintain, if code grow large.
•It does not have automatic memory management like java.
•There is no security of data.
•Difficult to modify old codes.
•There are no access specifies.
![Page 8: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/8.jpg)
![Page 9: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/9.jpg)
What Object-Oriented Programming?
• Object-oriented programming is centred on
creating objects rather than procedures/
functions.
• Objects are a melding of data and procedures
that manipulate that data.
• Data in an object are known as attributes.
• Procedures/functions in an object are known
as methods.
![Page 10: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/10.jpg)
![Page 11: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/11.jpg)
• Object
• Class
• Message
• Basic Principles of Object Orientation
• Abstraction
• Encapsulation
• Inheritance
• Polymorphism
• Interface and Abstract Class
Concepts of object oriented programming:
![Page 12: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/12.jpg)
• Informally, an object represents an entity, either physical,
conceptual, or software.
– Physical entity
– Conceptual entity
– Software entity
Truck
Chemical Process
Linked List
![Page 13: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/13.jpg)
• The state of an object normally changes over time.
Name: J ClarkEmployee ID: 567138HireDate: 07/25/1991Status: TenuredDiscipline: FinanceMaxLoad: 3
Name: J ClarkEmployee ID: 567138Date Hired: July 25, 1991Status: TenuredDiscipline: FinanceMaximum Course Load: 3 classes
Professor Clark
Professor Clark
![Page 14: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/14.jpg)
• Behavior determines how an object acts and reacts.
• The visible behavior of an object is modeled by the set of
messages it can respond to (operations the object can perform).
Professor Clark’s behaviorSubmit Final GradesAccept Course OfferingTake SabbaticalMaximum Course Load: 3 classes TakeSabbatical()
Professor Clark
Professor Clark
![Page 15: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/15.jpg)
Modularity is a fundamental aspect of all
successful large programs.
Abstraction
Emphasizes relevant characteristics.
Suppresses other characteristics
Data Abstraction:
BriefCase- Capacity- Weight
+ open()
+ close()
![Page 16: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/16.jpg)
• Encapsulation means to design, produce, and describe software so that it can be easily used without knowing the details of how it works.
• Also known as information hiding
![Page 17: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/17.jpg)
Interface
Implementation details which are invisible for client
Information which can’t be accessed by client
Client Deposit()Withdraw()Transfer()
BalanceinsterestYTDOwnerAccount_number
Deposit() {…}Withdraw() {…}Transfer() {…}
![Page 18: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/18.jpg)
• Inheritance —a way of organizing classes
• Term comes from inheritance of traits like eye color, hair color,
and so on.
• Classes with properties in common can be grouped so that
their common properties are only defined once.
• Is an “is a kind of” relationship
![Page 19: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/19.jpg)
Vehicle
Automobile Motorcycle Bus
Sedan Sports Car School Bus Luxury Bus
![Page 20: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/20.jpg)
Polymorphism:
•The word polymorphism comes from Greek and means having
several different forms. This is one of the essential concepts of
object-oriented programming.
• Where inheritance is related to classes and (their hierarchy),
polymorphism is related to object methods.
•Types of polymorphism :Overloading polymorphismParametric polymorphism
![Page 21: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/21.jpg)
Advantages of Object-Oriented languages include:
•Ease of management.
•Understand ability.
•Re-usability.
•Improved software-development productivity.
•Improved software maintainability.
•Faster development.
•Lower cost of development.
•Higher-quality software.
![Page 22: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/22.jpg)
•The disadvantages of Object-Oriented languages include:
•Over-generalization.
•Programs that are built using this language tend to take
longer to initially create.
•Slower program.
![Page 23: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/23.jpg)
Object oriented programming.Vs
Procedural oriented programming.
![Page 24: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/24.jpg)
OOP POP
Centres in data types (classes,
prototypes)
Functions.
Data scope encapsulated data global data
What is firstdata types then algorithms algorithms then data types
Subroutines are calledmethods functions
Who access who
data is accessed by code, i.e.
ObjectInstance.getMeARando
mNumber();
code is accessed by data, i.e.
random_number =
getMeARandomNumber();
Have global dataNo, but objects can have
public members
Yes, but functions can have
private variables
Data is calledmember variable
![Page 25: Presentation c](https://reader036.vdocument.in/reader036/viewer/2022062514/5596db701a28abdb6a8b46e7/html5/thumbnails/25.jpg)
Any Questions?