15-09-2017, 12:54 PM
Object-oriented programming
Object-oriented programming is a programming paradigm that uses abstraction (in the form of classes and objects) to create models based on the real-world environment. An object-oriented application uses a collection of objects, which communicate by passing messages to request services. Objects are capable of transmitting messages, receiving messages and processing data. The goal of object-oriented programming is to try to increase the flexibility and maintainability of programs. Because programs created using OO language are modular, they can be easier to develop and easier to understand after development.
Object-Oriented Programming vs. Programming Procedures
Programs are made up of modules, which are parts of a program that can be coded and tested separately, and then assembled to form a complete program. In procedural languages (ie, C) these modules are procedures, where a procedure is a sequence of statements. In C, for example, the procedures are a sequence of imperative statements, such as assignments, tests, loops and invocations of sub-procedures. These procedures are functions, which map arguments to return statements.
The design method used in programming procedures is called Top Down Design. This is where you start with a problem (procedure) and then systematically break the problem into sub problems (sub procedures). This is called functional decomposition, which continues until a secondary problem is direct enough to be solved by the corresponding subprocedure. The difficulties with this type of programming, is that software maintenance can be difficult and slow. When changes are made in the main procedure (above), these changes can cascade to the subprocedures of main, and sub-sub procedures and so on, where the change can affect all the procedures of the pyramid.
An alternative to procedural programming is object-oriented programming. Object-oriented programming aims to solve difficulties with the programming of procedures. In object-oriented programming, the main modules of a program are classes, rather than procedures. The object-oriented approach allows you to create classes and objects that model real-world objects.
Object-oriented programming is a programming paradigm that uses abstraction (in the form of classes and objects) to create models based on the real-world environment. An object-oriented application uses a collection of objects, which communicate by passing messages to request services. Objects are capable of transmitting messages, receiving messages and processing data. The goal of object-oriented programming is to try to increase the flexibility and maintainability of programs. Because programs created using OO language are modular, they can be easier to develop and easier to understand after development.
Object-Oriented Programming vs. Programming Procedures
Programs are made up of modules, which are parts of a program that can be coded and tested separately, and then assembled to form a complete program. In procedural languages (ie, C) these modules are procedures, where a procedure is a sequence of statements. In C, for example, the procedures are a sequence of imperative statements, such as assignments, tests, loops and invocations of sub-procedures. These procedures are functions, which map arguments to return statements.
The design method used in programming procedures is called Top Down Design. This is where you start with a problem (procedure) and then systematically break the problem into sub problems (sub procedures). This is called functional decomposition, which continues until a secondary problem is direct enough to be solved by the corresponding subprocedure. The difficulties with this type of programming, is that software maintenance can be difficult and slow. When changes are made in the main procedure (above), these changes can cascade to the subprocedures of main, and sub-sub procedures and so on, where the change can affect all the procedures of the pyramid.
An alternative to procedural programming is object-oriented programming. Object-oriented programming aims to solve difficulties with the programming of procedures. In object-oriented programming, the main modules of a program are classes, rather than procedures. The object-oriented approach allows you to create classes and objects that model real-world objects.