SlideShare a Scribd company logo
1 of 15
Objectives

•To emphasize the difference between
procedural and object-oriented thinking
•To present example illustrating the difference
Procedural vs. Object-Oriented Programming

• The unit in procedural programming is function, and unit in
  object-oriented programming is class
• Procedural programming concentrates on creating
  functions, while object-oriented programming starts from
  isolating the classes, and then look for the methods inside
  them.
• Procedural programming separates the data of the program
  from the operations that manipulate the data, while object-
  oriented programming focus on both of them
Problem Description
• “Customers are allowed to Deposit money,
  Withdraw money, Balance Enquiry In Their
  Accounts”
• Adding Extra feature Overdraft Account
“Procedural Programming” Approach


               Data Access
       Data
                               Method


                        Call


              Method


4
Procedural Approach for The Problem
                Variables
                  AccountNo;
                   Balance;
                NameOfCustomer;

  Functions/Procedures Declaration
         //Calling Functions
           Switch(Choice)
                 Enter Your Choice
           Withdrawl();       //Choice 1
           Deposit();         //Choice 2
           BalanceEnquiry(); //Choice 3
Functions/Procedures Definition
             Withdrawl()
                  {
                     //Calculation
                  }
              Deposit()
                  {
                     //Calculation
                  }

           BalanceEnquiry()
                  {
                     //Calculation
                  }
Problem In Adding Extra Feature
               Variables
                  AccountNo;
                   Balance;
               NameOfCustomer;
                Overdraftlimit;
                 Overdraftfee;

 Functions/Procedures Declaration
        //Calling Functions
          Switch(Choice)
                Enter Your Choice
          Withdrawl();       //Choice 1
          Deposit();         //Choice 2
          BalanceEnquiry(); //Choice 3
          Overdraft();       //Choice 4
Functions/Procedures Definition
             Withdrawl()
                  {
                     //Calculation
                  }
              Deposit()
                  {
                     //Calculation
                  }

           BalanceEnquiry()
                  {
                     //Calculation
                  }
Overdraft()
{
         Setoverdraftlimit()
         {
                  //Calculations
         }
         GetAvailablefunds()
         {
                  //calculations
         }
         OverdraftWithdrawl()
         {
                  //Calculations
         }
}
Drawbacks Of Procedural
Over use of switch case makes code less maintainable

Modifications to Procedures usually require modifications to whole program thus more
difficult to modify

Focus is on procedures

All data is shared: no protection

Hard to manage complexity

Ordered Algorithm

When the application is designed around the procedural aspects of the users
business, then the structure of the application must change as the business practice
changes.
Using OOP Concept

 Inheritance
Polymorphism
Encapsulation
 Abstraction
Object Oriented Approach for The
                  Problem
                       Class Account                Base/Super Class
                          AccountNo;
Private variables
                            Balance;
                       NameofCustomer;
                           Deposit ();
Public Methods           Withdrawl();
                       BalanceEnquiry();


                        Class Overdraft      Inherited Class
                        Overdraftlimit;
  Private variables
                         Overdraftfee;                  Added Extra Feature
                                                        Overdraft Account
                      SetOverdraftlimit();
                      GetAvailableFunds();
  Public Methods
                         Withdrawl();                  Overrided Method

12
Public Main()
{
Account MyAccount= new Account(1); // Instantiated Object
MyAccount.Deposit(500);             // Calling Method
MyAccount. Withdrawl(200);        // Calling Method

OverdraftAccount MyAccount1 = new OverdraftAccount(); ); // Instantiated Object
MyAccount1.SetOverdraftlimit(400); // Calling Method
MyAccount1.Withdrawl(100)          // Calling Overrided Method

//Output

}
Benefits Of OOPS
            Reusability
 Easily Extensible And Modifiable
       Encapsulate The Data
            Abstraction
            Use Access
Specifiers:Public,Private,Protected
    Good For Large Programs
       Partitioned the Work
      Nonordered Algorithm
THANKS

More Related Content

Similar to Oopvspro

L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09Daniel Bryant
 
Unit test candidate solutions
Unit test candidate solutionsUnit test candidate solutions
Unit test candidate solutionsbenewu
 
CQRS and what it means for your architecture
CQRS and what it means for your architectureCQRS and what it means for your architecture
CQRS and what it means for your architectureRichard Banks
 
Introduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphereIntroduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphereeLink Business Innovations
 
Account.h Definition of Account class. #ifndef ACCOUNT_H #d.pdf
Account.h  Definition of Account class. #ifndef ACCOUNT_H #d.pdfAccount.h  Definition of Account class. #ifndef ACCOUNT_H #d.pdf
Account.h Definition of Account class. #ifndef ACCOUNT_H #d.pdfanujmkt
 
Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsSalesforce Developers
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf Conference
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuningAOE
 
The art of the event streaming application: streams, stream processors and sc...
The art of the event streaming application: streams, stream processors and sc...The art of the event streaming application: streams, stream processors and sc...
The art of the event streaming application: streams, stream processors and sc...confluent
 
Kafka summit SF 2019 - the art of the event-streaming app
Kafka summit SF 2019 - the art of the event-streaming appKafka summit SF 2019 - the art of the event-streaming app
Kafka summit SF 2019 - the art of the event-streaming appNeil Avery
 
Tool Development 07 - Undo & Redo, Drag & Drop
Tool Development 07 - Undo & Redo, Drag & DropTool Development 07 - Undo & Redo, Drag & Drop
Tool Development 07 - Undo & Redo, Drag & DropNick Pruehs
 
Single page webapps & javascript-testing
Single page webapps & javascript-testingSingle page webapps & javascript-testing
Single page webapps & javascript-testingsmontanari
 
Behavioral pattern 4
Behavioral pattern 4Behavioral pattern 4
Behavioral pattern 4Naga Muruga
 
Open Source ERP Technologies for Java Developers
Open Source ERP Technologies for Java DevelopersOpen Source ERP Technologies for Java Developers
Open Source ERP Technologies for Java Developerscboecking
 

Similar to Oopvspro (20)

L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
 
Unit test candidate solutions
Unit test candidate solutionsUnit test candidate solutions
Unit test candidate solutions
 
CQRS and what it means for your architecture
CQRS and what it means for your architectureCQRS and what it means for your architecture
CQRS and what it means for your architecture
 
Introduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphereIntroduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphere
 
Account.h Definition of Account class. #ifndef ACCOUNT_H #d.pdf
Account.h  Definition of Account class. #ifndef ACCOUNT_H #d.pdfAccount.h  Definition of Account class. #ifndef ACCOUNT_H #d.pdf
Account.h Definition of Account class. #ifndef ACCOUNT_H #d.pdf
 
Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong Foundations
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
Discrete Job Closure Process
Discrete Job Closure ProcessDiscrete Job Closure Process
Discrete Job Closure Process
 
Yii Introduction
Yii IntroductionYii Introduction
Yii Introduction
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
 
Lecture02
Lecture02Lecture02
Lecture02
 
The art of the event streaming application: streams, stream processors and sc...
The art of the event streaming application: streams, stream processors and sc...The art of the event streaming application: streams, stream processors and sc...
The art of the event streaming application: streams, stream processors and sc...
 
Kafka summit SF 2019 - the art of the event-streaming app
Kafka summit SF 2019 - the art of the event-streaming appKafka summit SF 2019 - the art of the event-streaming app
Kafka summit SF 2019 - the art of the event-streaming app
 
Tool Development 07 - Undo & Redo, Drag & Drop
Tool Development 07 - Undo & Redo, Drag & DropTool Development 07 - Undo & Redo, Drag & Drop
Tool Development 07 - Undo & Redo, Drag & Drop
 
Plsql guide 2
Plsql guide 2Plsql guide 2
Plsql guide 2
 
Single page webapps & javascript-testing
Single page webapps & javascript-testingSingle page webapps & javascript-testing
Single page webapps & javascript-testing
 
Behavioral pattern 4
Behavioral pattern 4Behavioral pattern 4
Behavioral pattern 4
 
Stored procedures
Stored proceduresStored procedures
Stored procedures
 
Open Source ERP Technologies for Java Developers
Open Source ERP Technologies for Java DevelopersOpen Source ERP Technologies for Java Developers
Open Source ERP Technologies for Java Developers
 

Recently uploaded

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
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
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
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
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
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
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 

Recently uploaded (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
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
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
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
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
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 🔝✔️✔️
 
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
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 

Oopvspro

  • 1. Objectives •To emphasize the difference between procedural and object-oriented thinking •To present example illustrating the difference
  • 2. Procedural vs. Object-Oriented Programming • The unit in procedural programming is function, and unit in object-oriented programming is class • Procedural programming concentrates on creating functions, while object-oriented programming starts from isolating the classes, and then look for the methods inside them. • Procedural programming separates the data of the program from the operations that manipulate the data, while object- oriented programming focus on both of them
  • 3. Problem Description • “Customers are allowed to Deposit money, Withdraw money, Balance Enquiry In Their Accounts” • Adding Extra feature Overdraft Account
  • 4. “Procedural Programming” Approach Data Access Data Method Call Method 4
  • 5. Procedural Approach for The Problem Variables AccountNo; Balance; NameOfCustomer; Functions/Procedures Declaration //Calling Functions Switch(Choice) Enter Your Choice Withdrawl(); //Choice 1 Deposit(); //Choice 2 BalanceEnquiry(); //Choice 3
  • 6. Functions/Procedures Definition Withdrawl() { //Calculation } Deposit() { //Calculation } BalanceEnquiry() { //Calculation }
  • 7. Problem In Adding Extra Feature Variables AccountNo; Balance; NameOfCustomer; Overdraftlimit; Overdraftfee; Functions/Procedures Declaration //Calling Functions Switch(Choice) Enter Your Choice Withdrawl(); //Choice 1 Deposit(); //Choice 2 BalanceEnquiry(); //Choice 3 Overdraft(); //Choice 4
  • 8. Functions/Procedures Definition Withdrawl() { //Calculation } Deposit() { //Calculation } BalanceEnquiry() { //Calculation }
  • 9. Overdraft() { Setoverdraftlimit() { //Calculations } GetAvailablefunds() { //calculations } OverdraftWithdrawl() { //Calculations } }
  • 10. Drawbacks Of Procedural Over use of switch case makes code less maintainable Modifications to Procedures usually require modifications to whole program thus more difficult to modify Focus is on procedures All data is shared: no protection Hard to manage complexity Ordered Algorithm When the application is designed around the procedural aspects of the users business, then the structure of the application must change as the business practice changes.
  • 11. Using OOP Concept Inheritance Polymorphism Encapsulation Abstraction
  • 12. Object Oriented Approach for The Problem Class Account Base/Super Class AccountNo; Private variables Balance; NameofCustomer; Deposit (); Public Methods Withdrawl(); BalanceEnquiry(); Class Overdraft Inherited Class Overdraftlimit; Private variables Overdraftfee; Added Extra Feature Overdraft Account SetOverdraftlimit(); GetAvailableFunds(); Public Methods Withdrawl(); Overrided Method 12
  • 13. Public Main() { Account MyAccount= new Account(1); // Instantiated Object MyAccount.Deposit(500); // Calling Method MyAccount. Withdrawl(200); // Calling Method OverdraftAccount MyAccount1 = new OverdraftAccount(); ); // Instantiated Object MyAccount1.SetOverdraftlimit(400); // Calling Method MyAccount1.Withdrawl(100) // Calling Overrided Method //Output }
  • 14. Benefits Of OOPS Reusability Easily Extensible And Modifiable Encapsulate The Data Abstraction Use Access Specifiers:Public,Private,Protected Good For Large Programs Partitioned the Work Nonordered Algorithm