OOPS : Advantages and Features Of Object Oriented Programming

What is object oriented programming?

Object oriented programming language (OOPL) is a high level programming language based on objected oriented programming model (OOPM). Object oriented programming comprises of logical classes, objects, methods and relationships.
Object oriented programming is a programming language that focuses on objects (i.e. data) rather than logic (i.e. procedures). If we talk about structured programming language then it focuses on procedures and not on the data. So in object oriented programming we focus on how we can manipulate the object rather than logic which are used to manipulate data of the object. Each object is independent of each other and executed independently. It can execute by itself and can be interchanged with other objects. Object interacts by interchanging information with each other.

Advantages of Object Oriented Programming

  1. Objects are created on real world entities. 
  2. Through object oriented programming language, complex systems of real world can be converted into software solutions. 
  3. Large programs are difficult to develop. Objected oriented programs focuses the developer to do extensive planning which will reduces programming flaws and better design. 
  4. Software maintenance of the object oriented programming is easier than as compared with structured oriented programming as much time has been invested while doing the planning of the code so minimum flaws are found. 
  5. Object oriented programming can be easily reused in other programs due to its re-usability feature. 
  6. Objected oriented programming is easy to implement. 
  7. Object oriented programming can easily extensible. New features or changes in operating environment can be easily done.
 Let us discuss some of the basic characteristics of OOPS in brief, subsequently I will discuss them in detail.

Basic features of object oriented programming language:

 Encapsulation
Encapsulation is a concept in object oriented programming which focuses on protecting the variable and function from outside the world in order to manage the piece of code in better way and produce least impact on other part of the code.

Important points about encapsulation
  • The internal details about what the object does can be hidden by using encapsulation. The problem can be solved at the implementation level itself.
  • With defining a class or structure it is possible to define the accessibility of the members (methods, properties, variables) to the code outside it. Encapsulation can thus help us control the interaction between objects.
  • The data of an object can be used by another object without knowing the entire data. For example, an Employee object may have name, address, company, and department as its properties. If a third party object wants to use the Employee object, it can request the name and address for the employee without needing to know the company and department details of the object.
Thus a great benefit of encapsulation is that it can change the internal implementation of a class without altering the overall system.

 Abstraction
Abstraction is the process of implementing the essential features and removing unnecessary information. Abstraction is an important characteristic in which the programmer hides the irrelevant details which will in turn reduces the size of the code and the complexity of the code. Abstraction makes things more general, simpler and abstract.

Important points about Abstraction
  • Abstraction makes code readable and simpler to understand. The codes are simple to understand as the complexity of the code is hidden from the user.
  • The size of the code is reduced as through abstraction we do not show unnecessary codes.
  • If we don’t apply abstraction to codes then it is difficult to maintain the codes.
  • Through abstraction, we simplify the representation of Domain Model.
  • Abstraction grouped the data of same type together and separate different type. 

 Inheritance
Inheritance is another main feature of object oriented programming language. Inheritance allows the class to use the property and method of other class. In other words, we can say that the sub classes derive the property and functionality from the base class. Subclass is also known as derived class and base class is known as super class.

The important points about inheritance
  • Inheritance allows the developers to reuse the codes so that time and effort can be saved.
  • A subclass can be treated as if it is a super class.
  • It is possible to create a class of extended and exclusive functionality without having to change the functionalities and properties of the super class.
  • Through inheritance the relationships among objects(of sub class and super class) can easily be established 

 Polymorphism
Polymorphism is way by which we are defining multiple functionalities under the same names. In other words we can say that we have the same code or operation but it will behave differently in different contexts.

Some points to remember about polymorphism
  • A functionality can behave differently for different instances
  • The behaviour depends on the type of data used in the operation
  • Polymorphism is used for implementing inheritance. 

Read  More
Difference between Automated Testing and Manual Testing
Drivers and Stubs in Software testing
Benefits and drawbacks of whitebox testing

  Copyright © ianswer4u.com

0 Reactions:

Post a Comment