Object Oriented Programing (OOP)
“Object-oriented programming 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”.
- OOP defines classes to represent these things.
- Classes can contain data and methods (internal functions).
- Classes control access to internal data and methods. A public interface is used by external code when using the class.
- This is a highly effective way of modeling real-world problems inside a computer program.
FIGURE: The object-oriented paradigm.
Features of the Object Oriented programming
- Emphasis is on doing rather than procedure.
- programs are divided into what are known as objects.
- Data structures are designed such that they characterize the objects.
- Functions that operate on the data of an object are tied together in the data structure.
- Data is hidden and can’t be accessed by external functions.
- Objects may communicate with each other through functions.
- New data and functions can be easily added.
- Follows bottom-up approach in program design.
Advantages of OOP
Object-oriented programming offers several major advantages to software development:
- Reduced susceptibility to errors: an object controls access to its own data. More specifically, an object can reject erroneous access attempts
- easy re-use: objects maintain themselves and can therefore be used as building blocks for other programs
- low maintenance requirement: an object type can modify its own internal data representation without requiring changes to the application.
Comments
Post a Comment