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
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
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