Beruflich Dokumente
Kultur Dokumente
The procedure oriented programming characterizes a program as a series of user-defined functions Given problem (verbal/written description of a problem) is split into more manageable modules Then design a number of data structures that hold our data and we implement a number of functions to operate on this data
Object Oriented Programming - Introduction R.B. Lenin Winter 2007 DA-IICT 5
These functions would modify the data structures, store them to files and also print them So, all knowledge about the system is built into a set of functions The prime focus is on these functions which is the style of procedure oriented programming
Object Oriented Programming - Introduction R.B. Lenin Winter 2007 DA-IICT 6
R.B. Lenin
Winter 2007
DA-IICT
Procedure Oriented Programming A procedure-oriented code can be thought of as code acting on data Information that is more important to us is in the data stored in data structures The functions we implement are simple tools to modify these data structures
Object Oriented Programming - Introduction R.B. Lenin Winter 2007 DA-IICT 8
R.B. Lenin
Winter 2007
DA-IICT
10
Procedure Oriented Programming Global data are more vulnerable to an inadvertent change by a function In a large program, it is very difficult to identify what data is used by which function In case we need to revise an external data structure, we also need to revise all function that access the data
Object Oriented Programming - Introduction R.B. Lenin Winter 2007 DA-IICT 11
Procedure Oriented Programming Problems with this approach will start appear as programs grow larger and more complex For example, C employs this approach to considerable success To manage increasing complexity, the second approach, called Object Oriented Programming (OOP), was conceived
Object Oriented Programming - Introduction R.B. Lenin Winter 2007 DA-IICT 13
Objected Oriented Programming OOP treats data as a critical element in the program development and does not allow it to flow freely around the system It ties data more closely to the functions that operate on it and protects it from accidental modification from outside functions It allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects
Object Oriented Programming - Introduction R.B. Lenin Winter 2007 DA-IICT 14
R.B. Lenin
Winter 2007
DA-IICT
15
Object Oriented Programming OOP is an approach that provides a way of modularizing programs by creating partitioned memory area for both data and functions that can be used as templates for creating copies of such modules on demand Therefore, an object is considered to be a partitioned area of computer memory that stores data and set of operations that can access that data.
Object Oriented Programming - Introduction R.B. Lenin Winter 2007 DA-IICT 16
R.B. Lenin
Winter 2007
DA-IICT
17
R.B. Lenin
Winter 2007
DA-IICT
18
R.B. Lenin
Winter 2007
DA-IICT
R.B. Lenin
Winter 2007
DA-IICT
20
R.B. Lenin
Winter 2007
DA-IICT
21