SlideShare a Scribd company logo
1 of 11
Procedure Oriented
Programming
• It means “a set of procedures” which is a
“set of subroutines” or a “set of
functions“.
• functions are called repeatedly in a program to
execute/complete tasks performed by them. For
example, a program may involve collecting data
from user (reading), performing some kind of
calculations on the collected data (calculation),
and finally displaying the result to the user when
requested (printing). All the 3 tasks of reading,
calculating and printing can be written in a
program with the help of 3 different functions
which performs these 3 different tasks.
A Real-World
Example
• Let's say that you are working for a vehicle parts
manufacturer that needs to update it's online
inventory system. Your boss tells you to program
two similar but separate forms for a website, one
form that processes information about cars and
one that does the same for trucks.
• For cars, we will need to record the following
information: Color, Engine Size, Transmission Type,
Number of doors
• For trucks, the information will be similar, but
slightly different. We need:
Color, Engine Size, Transmission Type, Cab Size,
Towing Capacity
Scenario 1
• Suppose that we suddenly need to add a
bus form, that records the following
information: Color, Engine Size,
Transmission Type
Number of passengers
• Procedural: We need to recreate the entire
form, repeating the code for Color, Engine
Size, and Transmission Type.
• OOP: We simply extend the vehicle class
with a bus class and add the method,
number Of Passengers.
Scenario 2
• Instead of storing color in a database like we
previously did, for some strange reason our
client wants the color emailed to him.
• Procedural: We change three different
forms: cars, trucks, and buses to email the
color to the client rather than storing it in
the database.
• OOP: We change the color method in the
vehicle class and because the car, truck, and
bus classes all extend (or inherit from, to put
it another way) the vehicle class, they are
automatically updated.
Scenario 3
• We want to move from a car to specific
makes, for example: Nissan and Mazda.
• Procedural: We create a new form for each
make, repeating all of the code for car
information and adding the code specific to
each make.
• OOP: We extend the car class with a Nissan
class and a Mazda class and add methods
for each set of unique information for that
car make.
Procedural vs. Object-Oriented Programming
POP OOP
In POP, program is divided into small
parts
called functions.
In OOP, program is divided into parts
called objects.
POP does not have any proper way for
hiding data so it is less secure.
OOP provides Data Hiding so
provides more security.
Example of POP are : C, VB,
FORTRAN,
Pascal.
Example of OOP are : C++, JAVA,
VB.NET,
C#.NET.
Procedur
al:
Top down
design
Global data
focused
Limited code
reuse
Complex
code
Object-Oriented:
Object focused
design
Protected
data
Code
reuse
Complex
design
VS
.
Procedural vs. Object-Oriented
Programming
Object Oriented Methodology is a
certain process through which
software can be developed. The goals
of this methodology are to achieve
Software Systems that are reliable,
reusable, extensible; hence, more
useful in the long run. The methodology
achieves its goals by the help of a
collection of objects that communicate
by exchanging messages.
Object
s
• Hence, every o
Towards a higher level of abstraction
bject has 3 important features
– 1. Characteristics (e.g. Name, Designation, Job description
etc.)
– 2. Responsibilities (e.g. drive bus, fly plane etc.) – these are
assigned on the basis of the object’s characteristics – A
manager object would have different responsibilities than a
developer, since their job descriptions (a characteristic) would
be different:
– 3. Relationships with other objects (explained in detail later) – in
order to send requests/messages to each other, objects need to
have some relationship/connection. E.g. A bus driver needs to
have access/connection to a bus in order to drive it.
Class
es
• Exercise: What class/category do these
objects belong to?
– Pencils, erasers, pens, rulers, sharpeners?
– Bananas, apples, oranges, peaches, grapes?
– Alice, Bob, Mark, Fahd, Ali, Brian?
• Guideline: A class usually represents a
noun
Classes vs.
Objects
some pictorial examples

More Related Content

What's hot

What's hot (20)

Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
 
Oops concept on c#
Oops concept on c#Oops concept on c#
Oops concept on c#
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
 
Tcp/ip server sockets
Tcp/ip server socketsTcp/ip server sockets
Tcp/ip server sockets
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and Packages
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
screen output and keyboard input in js
screen output and keyboard input in jsscreen output and keyboard input in js
screen output and keyboard input in js
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
 
Asp.NET Validation controls
Asp.NET Validation controlsAsp.NET Validation controls
Asp.NET Validation controls
 
Intro to c++
Intro to c++Intro to c++
Intro to c++
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Python Exception Handling
Python Exception HandlingPython Exception Handling
Python Exception Handling
 
Scope rules : local and global variables
Scope rules : local and global variablesScope rules : local and global variables
Scope rules : local and global variables
 
Data Types & Variables in JAVA
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVA
 
Managing I/O in c++
Managing I/O in c++Managing I/O in c++
Managing I/O in c++
 
File handling in c++
File handling in c++File handling in c++
File handling in c++
 
Virtual base class
Virtual base classVirtual base class
Virtual base class
 
Web technology practical list
Web technology practical listWeb technology practical list
Web technology practical list
 
Inline function
Inline functionInline function
Inline function
 

Similar to Procedure Oriented Programming Principles

PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING
PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING
PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING Uttam Singh
 
Basic concepts of parallelization
Basic concepts of parallelizationBasic concepts of parallelization
Basic concepts of parallelizationsnegacmr
 
Continuous delivery for machine learning
Continuous delivery for machine learningContinuous delivery for machine learning
Continuous delivery for machine learningRajesh Muppalla
 
Intro to C++ - Class 2 - Objects & Classes
Intro to C++ - Class 2 - Objects & ClassesIntro to C++ - Class 2 - Objects & Classes
Intro to C++ - Class 2 - Objects & ClassesBlue Elephant Consulting
 
Intro To C++ - Class 2 - An Introduction To C++
Intro To C++ - Class 2 - An Introduction To C++Intro To C++ - Class 2 - An Introduction To C++
Intro To C++ - Class 2 - An Introduction To C++Blue Elephant Consulting
 
Programming using C++ - slides.pptx
Programming using C++ - slides.pptxProgramming using C++ - slides.pptx
Programming using C++ - slides.pptxHeadoftheDepartment
 
PRETZEL: Opening the Black Box of Machine Learning Prediction Serving Systems
PRETZEL: Opening the Black Box of Machine Learning Prediction Serving SystemsPRETZEL: Opening the Black Box of Machine Learning Prediction Serving Systems
PRETZEL: Opening the Black Box of Machine Learning Prediction Serving SystemsNECST Lab @ Politecnico di Milano
 
CS8494 SOFTWARE ENGINEERING Unit-5
CS8494 SOFTWARE ENGINEERING Unit-5CS8494 SOFTWARE ENGINEERING Unit-5
CS8494 SOFTWARE ENGINEERING Unit-5SIMONTHOMAS S
 
A WEB BASED APPLICATION FOR RESUME PARSER USING NATURAL LANGUAGE PROCESSING T...
A WEB BASED APPLICATION FOR RESUME PARSER USING NATURAL LANGUAGE PROCESSING T...A WEB BASED APPLICATION FOR RESUME PARSER USING NATURAL LANGUAGE PROCESSING T...
A WEB BASED APPLICATION FOR RESUME PARSER USING NATURAL LANGUAGE PROCESSING T...IRJET Journal
 
N - Tier Applications, Enterprise Java Beans, Component technologies
N - Tier Applications, Enterprise Java Beans, Component technologiesN - Tier Applications, Enterprise Java Beans, Component technologies
N - Tier Applications, Enterprise Java Beans, Component technologiesMartin A
 
MongoDB World 2018: Data Models for Storing Sophisticated Customer Journeys i...
MongoDB World 2018: Data Models for Storing Sophisticated Customer Journeys i...MongoDB World 2018: Data Models for Storing Sophisticated Customer Journeys i...
MongoDB World 2018: Data Models for Storing Sophisticated Customer Journeys i...MongoDB
 
Managing Large Flask Applications On Google App Engine (GAE)
Managing Large Flask Applications On Google App Engine (GAE)Managing Large Flask Applications On Google App Engine (GAE)
Managing Large Flask Applications On Google App Engine (GAE)Emmanuel Olowosulu
 
Lesson 26. Optimization of 64-bit programs
Lesson 26. Optimization of 64-bit programsLesson 26. Optimization of 64-bit programs
Lesson 26. Optimization of 64-bit programsPVS-Studio
 

Similar to Procedure Oriented Programming Principles (20)

Chapter 1
Chapter 1Chapter 1
Chapter 1
 
ProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPSProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPS
 
PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING
PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING
PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING
 
73d32 session1 c++
73d32 session1 c++73d32 session1 c++
73d32 session1 c++
 
Intro To C++ - Class 14 - Midterm Review
Intro To C++ - Class 14 - Midterm ReviewIntro To C++ - Class 14 - Midterm Review
Intro To C++ - Class 14 - Midterm Review
 
Basic concepts of parallelization
Basic concepts of parallelizationBasic concepts of parallelization
Basic concepts of parallelization
 
Continuous delivery for machine learning
Continuous delivery for machine learningContinuous delivery for machine learning
Continuous delivery for machine learning
 
Intro to C++ - Class 2 - Objects & Classes
Intro to C++ - Class 2 - Objects & ClassesIntro to C++ - Class 2 - Objects & Classes
Intro to C++ - Class 2 - Objects & Classes
 
Intro To C++ - Class 2 - An Introduction To C++
Intro To C++ - Class 2 - An Introduction To C++Intro To C++ - Class 2 - An Introduction To C++
Intro To C++ - Class 2 - An Introduction To C++
 
Resume
ResumeResume
Resume
 
Aa03101540158
Aa03101540158Aa03101540158
Aa03101540158
 
Programming using C++ - slides.pptx
Programming using C++ - slides.pptxProgramming using C++ - slides.pptx
Programming using C++ - slides.pptx
 
Architecture presentation 4
Architecture presentation 4Architecture presentation 4
Architecture presentation 4
 
PRETZEL: Opening the Black Box of Machine Learning Prediction Serving Systems
PRETZEL: Opening the Black Box of Machine Learning Prediction Serving SystemsPRETZEL: Opening the Black Box of Machine Learning Prediction Serving Systems
PRETZEL: Opening the Black Box of Machine Learning Prediction Serving Systems
 
CS8494 SOFTWARE ENGINEERING Unit-5
CS8494 SOFTWARE ENGINEERING Unit-5CS8494 SOFTWARE ENGINEERING Unit-5
CS8494 SOFTWARE ENGINEERING Unit-5
 
A WEB BASED APPLICATION FOR RESUME PARSER USING NATURAL LANGUAGE PROCESSING T...
A WEB BASED APPLICATION FOR RESUME PARSER USING NATURAL LANGUAGE PROCESSING T...A WEB BASED APPLICATION FOR RESUME PARSER USING NATURAL LANGUAGE PROCESSING T...
A WEB BASED APPLICATION FOR RESUME PARSER USING NATURAL LANGUAGE PROCESSING T...
 
N - Tier Applications, Enterprise Java Beans, Component technologies
N - Tier Applications, Enterprise Java Beans, Component technologiesN - Tier Applications, Enterprise Java Beans, Component technologies
N - Tier Applications, Enterprise Java Beans, Component technologies
 
MongoDB World 2018: Data Models for Storing Sophisticated Customer Journeys i...
MongoDB World 2018: Data Models for Storing Sophisticated Customer Journeys i...MongoDB World 2018: Data Models for Storing Sophisticated Customer Journeys i...
MongoDB World 2018: Data Models for Storing Sophisticated Customer Journeys i...
 
Managing Large Flask Applications On Google App Engine (GAE)
Managing Large Flask Applications On Google App Engine (GAE)Managing Large Flask Applications On Google App Engine (GAE)
Managing Large Flask Applications On Google App Engine (GAE)
 
Lesson 26. Optimization of 64-bit programs
Lesson 26. Optimization of 64-bit programsLesson 26. Optimization of 64-bit programs
Lesson 26. Optimization of 64-bit programs
 

More from MrShahbazRafiq

Principles of syllabus organizationt
Principles of syllabus organizationtPrinciples of syllabus organizationt
Principles of syllabus organizationtMrShahbazRafiq
 
Course planning and syllabus design
Course planning and syllabus design Course planning and syllabus design
Course planning and syllabus design MrShahbazRafiq
 
Syllabus design and materials development
Syllabus design and materials development Syllabus design and materials development
Syllabus design and materials development MrShahbazRafiq
 
Product oriented syllabus
Product oriented syllabusProduct oriented syllabus
Product oriented syllabusMrShahbazRafiq
 
Process oriented syllabus
Process oriented syllabusProcess oriented syllabus
Process oriented syllabusMrShahbazRafiq
 
course and syllabus design
course and syllabus designcourse and syllabus design
course and syllabus designMrShahbazRafiq
 
Course planning ands yllabusdesign
Course planning ands yllabusdesign Course planning ands yllabusdesign
Course planning ands yllabusdesign MrShahbazRafiq
 

More from MrShahbazRafiq (7)

Principles of syllabus organizationt
Principles of syllabus organizationtPrinciples of syllabus organizationt
Principles of syllabus organizationt
 
Course planning and syllabus design
Course planning and syllabus design Course planning and syllabus design
Course planning and syllabus design
 
Syllabus design and materials development
Syllabus design and materials development Syllabus design and materials development
Syllabus design and materials development
 
Product oriented syllabus
Product oriented syllabusProduct oriented syllabus
Product oriented syllabus
 
Process oriented syllabus
Process oriented syllabusProcess oriented syllabus
Process oriented syllabus
 
course and syllabus design
course and syllabus designcourse and syllabus design
course and syllabus design
 
Course planning ands yllabusdesign
Course planning ands yllabusdesign Course planning ands yllabusdesign
Course planning ands yllabusdesign
 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 

Procedure Oriented Programming Principles

  • 1. Procedure Oriented Programming • It means “a set of procedures” which is a “set of subroutines” or a “set of functions“. • functions are called repeatedly in a program to execute/complete tasks performed by them. For example, a program may involve collecting data from user (reading), performing some kind of calculations on the collected data (calculation), and finally displaying the result to the user when requested (printing). All the 3 tasks of reading, calculating and printing can be written in a program with the help of 3 different functions which performs these 3 different tasks.
  • 2. A Real-World Example • Let's say that you are working for a vehicle parts manufacturer that needs to update it's online inventory system. Your boss tells you to program two similar but separate forms for a website, one form that processes information about cars and one that does the same for trucks. • For cars, we will need to record the following information: Color, Engine Size, Transmission Type, Number of doors • For trucks, the information will be similar, but slightly different. We need: Color, Engine Size, Transmission Type, Cab Size, Towing Capacity
  • 3. Scenario 1 • Suppose that we suddenly need to add a bus form, that records the following information: Color, Engine Size, Transmission Type Number of passengers • Procedural: We need to recreate the entire form, repeating the code for Color, Engine Size, and Transmission Type. • OOP: We simply extend the vehicle class with a bus class and add the method, number Of Passengers.
  • 4. Scenario 2 • Instead of storing color in a database like we previously did, for some strange reason our client wants the color emailed to him. • Procedural: We change three different forms: cars, trucks, and buses to email the color to the client rather than storing it in the database. • OOP: We change the color method in the vehicle class and because the car, truck, and bus classes all extend (or inherit from, to put it another way) the vehicle class, they are automatically updated.
  • 5. Scenario 3 • We want to move from a car to specific makes, for example: Nissan and Mazda. • Procedural: We create a new form for each make, repeating all of the code for car information and adding the code specific to each make. • OOP: We extend the car class with a Nissan class and a Mazda class and add methods for each set of unique information for that car make.
  • 6. Procedural vs. Object-Oriented Programming POP OOP In POP, program is divided into small parts called functions. In OOP, program is divided into parts called objects. POP does not have any proper way for hiding data so it is less secure. OOP provides Data Hiding so provides more security. Example of POP are : C, VB, FORTRAN, Pascal. Example of OOP are : C++, JAVA, VB.NET, C#.NET.
  • 7. Procedur al: Top down design Global data focused Limited code reuse Complex code Object-Oriented: Object focused design Protected data Code reuse Complex design VS . Procedural vs. Object-Oriented Programming
  • 8. Object Oriented Methodology is a certain process through which software can be developed. The goals of this methodology are to achieve Software Systems that are reliable, reusable, extensible; hence, more useful in the long run. The methodology achieves its goals by the help of a collection of objects that communicate by exchanging messages.
  • 9. Object s • Hence, every o Towards a higher level of abstraction bject has 3 important features – 1. Characteristics (e.g. Name, Designation, Job description etc.) – 2. Responsibilities (e.g. drive bus, fly plane etc.) – these are assigned on the basis of the object’s characteristics – A manager object would have different responsibilities than a developer, since their job descriptions (a characteristic) would be different: – 3. Relationships with other objects (explained in detail later) – in order to send requests/messages to each other, objects need to have some relationship/connection. E.g. A bus driver needs to have access/connection to a bus in order to drive it.
  • 10. Class es • Exercise: What class/category do these objects belong to? – Pencils, erasers, pens, rulers, sharpeners? – Bananas, apples, oranges, peaches, grapes? – Alice, Bob, Mark, Fahd, Ali, Brian? • Guideline: A class usually represents a noun