Presentation is loading. Please wait.

Presentation is loading. Please wait.

OOP vs Structured Programming

Similar presentations


Presentation on theme: "OOP vs Structured Programming"— Presentation transcript:

1 OOP vs Structured Programming
TOPIC 1 OOP vs Structured Programming CSC238

2 Content 1 Structured Programming 2 Structured Programming Limitation
3 Object Oriented Programming(OOP) 4 Structured vs OOP

3 Structured Programming
Dividing a problem into smaller subproblems. Each subproblem is then analyzed and a solution for the subproblem is obtained. The solutions to all the subproblems are then combined to solve the overall problem. This process of implementing a structured design is called structured programming.

4 Structured Programming

5 Top Down approach A Single module will be split into several smaller modules General to Specific Bottom Up approach Lot of small modules will be grouped to form a single large module Specific to General Flexible If the requirements are clear at the first instance we can go for Top down approach In circumstances where the requirements may keep on adding, we go for Bottom up approach

6 Structured Programming
MAIN PROGRAM FUNCTION 3 FUNCTION 2 GLOBAL DATA FUNCTION 5 FUNCTION 4 FUNCTION 1 Using function Function & program is divided into modules Every module has its own data and function which can be called by other modules.

7 Limitation Structured Programming
a. Structured Programming is hard and takes a long time to master b. It concentrates on doing things. (Eg. Algorithms) c. Large programs are divided into smaller programs called Functions d. Most of the Functions share global data e. Data is accessible from one function to another f. Top down Approach

8 Object Oriented Programming
OOP is a programming style that is focused on objects Important Features of OOP Abstraction Encapsulation Inheritance Polymorphism

9 Object Oriented Programming
Data Function Object 3 Objects have both data and methods Objects of the same class have the same data elements and methods Objects send and receive messages to invoke actions

10 Structured Vs OOP Structured OOP Focuses on Process Focuses on Object
Follows Top-down, Bottom-up, stepwise refinement and modular programming Approach Follows Object oriented design

11 Structured VS OOP

12 Structured VS OOP

13 Structured VS OOP Structured programming is task-centric, object oriented programming is data-centric. Structured programming is based around data structures and subroutines. The subroutines are where stuff actually "happens", and the data structures are simply containers for the information needed by those subroutines. Object oriented programming, on the other hand, shifts your primary focus to the data itself. Instead of asking "what do I want to do and what will I need to know to do it", you ask "what kind of things do I want to have and what can those things do for me". Instead of designing your functions first and then coming up with data structures to support them, you design types first and then come up with the operations needed to work with them.

14 History C++ Extension of C Early 1980s: Bjarne Stroustrup (Bell Laboratories) Originally named “C with Classes”. Provides capabilities for object-oriented programming Objects: reusable software components Model items in real world Object-oriented programs Easy to understand, correct and modify Hybrid language C-like style Object-oriented style Both

15 Thank You !


Download ppt "OOP vs Structured Programming"

Similar presentations


Ads by Google