The introduction to object oriented was done to remove some of the flaws encountered in the procedural approach. OOP treats the data as the critical element in the program development and does not allow it to flow freely around the system. It ties the data more closely o the functions that operate on it and protects it from accidental modifications from the outside functions.
OOP allows the decomposition of a problem into a number of entities called objects and then builds data and functions around these objects. Organization of data and functions in an OOP can be shown as in the figure given below. The data of the object can only be accessed by the functions associated to that object .However. Functions of one object can access the function of other objects.
Features of OOP:
- Emphasis on data rather than procedures.
- Programs are divided into objects.
- Data Structures are designed such that they characterize the objects.
- Functions that operate on data of an object are tied together in the data structure.
- Data is hidden and cannot be accessed by external functions.
- Objects may communicate with each other through functions.
- New data and functions can be easily added where necessary.
- Follow bottom-up approach in program design.
OOP is a new concept among programming paradigms which has not been clear to all the people. It is therefore important to have a working definition of OOP as : “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. Thus, an object can be considered as the partitioned area of computer memory that stores data and set of operations that can access that data. Since the memory partitions are independent, the objects can be used in a variety of different programs without modifications.
Benefits of OOPs:
OOP is beneficial for both the designer as well as the user. It contributes to the solution of various problems as well as in development of quality software products. This new technology promises the greater programmer productivity, better quality software and lesser maintenance cost. Various principle advantages are:
- Use of inheritance enables to eliminate the redundant code and extend the use of existing class.
- Programs can be built from standard working modules that communicate with one another rather than having to start writing the code from scratch. This leads to saving of development time and higher productivity.
- It is possible to have multiple instances of an object to coexist without any interference.
- The principle of data hiding helps the programmer to build secure programs that cannot be invalid by code in other parts of the program.
- It is possible to have multiple instances of an object to co-exist without any interference.
- It is possible to map objects in the problem domain to those in the program.
- It is easy to partition the work in a project based on objects.
- The data-centered design approach enables us to capture more details of a model in implementable form.
- OO systems can be easily upgraded from small to large systems.
- Message passing techniques for communication between objects makes the interface descriptions with external systems much simpler.
- Software complexity can be easily managed.
- Real-time Systems.
- Simulation and modeling
- Object-Oriented databases
- Hypertext, hypermedia
- AI and Expert Systems
- Neural Network and Parallel Programming
- Decision support and office automation systems.
- CIM/ CAM/ CAD Systems.