Skip to main content

Benefits of Object Oriented Programming and its Applications

Article No: 3

The new technology promises greater programmer productivity, better quality of software and lesser maintenance cost.

Natural modeling
OOP resembles the real world more closely than the conventional procedural programming. Hence it serves as a more natural modeling tool for programming real world problems. Object-oriented design (often referred to as OOD) involves the identification and implementation of different classes of objects and their behaviors. The objects of the system closely correspond to the real world objects, as it is observed and understood by the brain. The effort required in the conventional procedural languages, for the translation or transformation of the facts perceived by the brain into some other form suitable to the system, gets greatly reduced with OOP. Hence designing and implementing a system is much easier in OOP.

Modular design
In OOP, objects are autonomous (independent) entities in the sense that the behavior of each object is defined and implemented in the object itself and are independent of the implementation of other objects. This independence of each object naturally provides the facility of modular system design. Object-oriented design (OOD), is an approach to software design in which the modular decomposition of a system is based on the classes of its objects the system manipulates, not on the function the system performs. Modular design eases the development and maintenance of software systems.
Abstraction
Abstraction is the principle that states that programs should not make assumptions about implementations and internal representations. In OOP, each object can be viewed as a shielded and encapsulated entity because its data is private to itself (hidden from other objects) and its interaction with other objects is only through its message interface. Any object can be requested for any required information or service by sending the suitable message to it. The requester gets what it asked for without the need to bother about how the object provides the information or service. The “how” part, that is, the implementation details are internal to the object, the supplier. Thus OOP provides a high degree of abstraction, which gives an opportunity to the programmers to concentrate more on problem specification rather than be taken away by the implementation details.

Dynamic Binding
In conventional programming languages, the operators, functions, etc. are bound to their respective operations at the time of compilation. This is called static binding. However, in OOP, the binding of operator to an operation takes place at run time. This is called dynamic binding. To have an understanding of this concept, let us consider the following situation. A class named ‘shape’ has been defined along with a collection of sub-classes for different kinds of shapes, such as circles, triangles, rectangles, etc. if objects of these sub-classes need to be displayed, the display method must be defined within the class of the particular kind of shape, for each kind of shape will require different display code. Suppose that a linked list of objects of various shapes is constructed, and code is written to display each object on the list. Then the message to “display_shape” is the same for each object on the list, but it must be dynamically bound to the “display_shape” method in the proper object. Naturally the same message “display_shape” sent to different has got different responses, which is termed polymorphism. Languages that provide this sort of dynamic binding are called polymorphic languages. Dynamic binding allows abstract data types to be truly generic because it enables a single operator to have more than one operation.

Code Reusability
In OOP, inheritance provides an effective method of code reuse because the common operations defined and implemented in a class can be accessed by all the classes and instances down the whole class hierarchy. That is, as and when new classes inherit from existing classes, the code developed in super-classes gets reused. This feature leads to tremendous saving of programming effort.

Ease of Maintenance
The modular design and code reusability features also help in making software system easy to maintain. This is because by making a change in a super-class, in effect all its sub-classes are changed at once, without the tedium of identifying and implementing the same changes at a number of places. Moreover, if changes are made in one sub-class to get distinctions, the code in the super-class and the other sub-classes remains safe.

APPLICATIONS OF OOP

·         Real-time systems
·         Simulation and modeling
·         Object oriented database
·         AI and expert systems
Decision support and office automation systems.

Compiled By: Chaudhary Amit V.

Comments

Popular posts from this blog

Characteristics of a Good Programming Language

Till now there are many high level languages which are very popular, and there are others, which could not become so popular in-spite of being very powerful. There might be many reasons for the success of a language, but one obvious reason is the characteristics of the language. Several characteristics believed to be important with respect to making a programming language good are briefly discussed below. Simplicity A good programming language must be simple and easy to learn and use. For example, BASIC is liked by many programmers only because of its simplicity. Thus, a good programming language should provide a programmer with a clear, simple and unified set of concepts which can be easily grasped. It is also easy to develop and implement a compiler or an interpreter for a programming language that is simple. However, the power needed for the language should not be sacrificed for simplicity. The overall simplicity of a programming language strongly affects the readability of the pr...

Angular 4 and Firebase Authentication: Setup

If you have come to this article, it means you are keen to learn new technology and that too Firebase. I love Firebase because it provides all basic but important features of any web application. Take for example, authentication, which is cumbersome and risky if not implemented with utmost care. And when we have the integration of Angular and Firebase, it becomes a lot easier for a developer to build such crucial modules in less time with minimal efforts. In this article we will create a simple Angular application using Firebase. I am going ahead with the understanding that you know the benefits of Firebase and have little knowledge about it. There are plenty of posts out on the web if you are behind. Step 1: Install Angular CLI (if not installed). npm install -g angular-cli Step 2: Create new Angular 4 project. By default now angular CLI will create Angular 4 project so you need not fret. ng new firebase-authentication Step 3: Check whether the ne...

Switch-case, simple calculator . . .

11.      Write a program to perform some mathematic functions with the help of “switch-case” statement. #include<stdio.h> #include<conio.h> void main() { int a,b,ans; char c; clrscr(); printf("\ Enter a and b:"); scanf("%d%d",&a,&b); printf("\n Enter operator:"); fflush(stdin); scanf("%c",&c); switch(c) { case'+':ans=a+b;       break; case'-':ans=a-b;       break; case'*':ans=a*b;       break; case'/':ans=a/b;       break; } printf("\n ans %d",ans); getch(); } 12.      Print the Fibonacci series #include<stdio.h> #include<conio.h> void main() { int a=1,b=1,s=3,c,ch; clrscr(); printf("how many steps="); scanf("%d",&ch); printf("%5d%5d",a,b); for(s=3;s<=ch;s++) {       c=a+b;       printf("%5d",c);       a=b;    ...