BASIC CONCEPTS OF OBJECT ORIENTED PROGRAMMING

BASIC CONCEPTS OF OBJECT ORIENTED PROGRAMMING 

The term object oriented means that we organize a problem as a collection of discrete objects that contains data and functions that operate on that data.  The Object Oriented Programming is a powerful way to approach the task of programming.  It is well suited for modelling real world problems as close as possible to the user's perspective.  It is a new way of thinking about programming that extensively use the following key concepts.

1. OBJECTS 

Objects are the key to understand object oriented programming approach.  It is often used to represent an entity in the real world that can be distinctly identified.  An object can be a person place, thing, concept or anything you see in the real world.  Some common examples of an object include car, book, clock, computer, apple etc.  
Every object is described by their attributes and behaviours.  An attribute possess certain properties that help to distinguish it from other objects.  For example: You as an object have attributes like name, age, sex, height etc.  Behaviour of an object tells us about what operations or functions an object is capable of performing.  For example: An object like you may move, sit, listen, speak etc.  
Objects used in programming are modelled in a similar manner after the real world objects as they also posses attributes as well as behaviours.  In the program, the data describes the object are referred to as attributes of an object.  The behaviour of an object is implemented using functions.

2. CLASS 

In the real world, you will often find many individual objects all of the same kind.  For ex ample: Consider an object - you.  Now you have certain properties (attributes) like your age, name, height etc.  and posses certain behaviour (functions) like you have some style of walking, speaking, eating.  Like your friends Pranav, Amit, Kiran also possess certain properties (attributes) like age, name, height etc.  and possess certain behaviours (functions) like walking, speaking, eating etc.  All these people represent different objects having the same properties (attributes) and common behaviours (functions).  So all these objects can be grouped together to form a class, Person.  Thus, a class is a group of objects with the same attributes and common behaviours.  It is just a template or blueprint using which individual objects are created.

3. ENCAPSULATION 

Encapsulation is a mechanism that binds together data and functions that manipulate that data into a single logical unit.  It keeps the data safe from any external interference and misuse.  In other words, encapsulation is wrapping up of data and related functions in a single unit called class.  The only way to access the data is through the function which are wrapped in the class.  These functions prepare the interfaces of the class through which the outside world (other classes) can access it.

4. ABSTRACTION 

An essential element of object oriented programming is abstraction.  Abstraction is a process that involves identifying the essential features without including the internal details.  In Object Oriented Programming, complexity is managed by using the concept of abstraction.  It is easier to understand the concept of abstraction through a real world analogy.  
Consider an example of a television which consists of features such as changing the channel, volume control, ON / OFF switch etc.  User interacts with television using interfaces like channel changer, volume controller and power button without going into internal details of the working of each of the interface.  The user is not concerned about how it receives signals over the air, translate them and display on the screen.  So it shows how the internal complexity of working of the television is hidden from the user.  Thus even a non-technical person can operate the television very easily.  
In Object Oriented Programming, classes uses the concept of Abstraction.  A class encapsulates the relevant data and functions that operate on data by hiding the complex implementation details from the user.  In other words, user needs to focus on what a class does rather than how it will be implemented.

5. INHERITANCE  

Inheritance is an important feature of Object Oriented Programming.  It is a process of deriving a new class from the existing class without modifying it.  The new class is called the derived class or subclass or child class and the existing class is called the base class or superclass or parent class.  The derived class inherits all the features (data and functions) of the base class and you can also add some new features into it.

6. POLYMORPHISM 

Polymorphism is a very powerful concept that allows the designing of amazingly flexible applications.  The word Polymorphism is derived from two Greek words Poly which means many and morphos which means forms.  So, Polymorphism means the ability to take many forms.

7. DYNAMIC Binding 

Binding refers to the linking of a function call to the code of the function to be executed in response to the function call.  Binding is of two types –
a) Static Binding or Early Binding 
b) Dynamic Binding or Late Binding 
In Static Binding, the linking of function call to the code of the function to be executed in response to the function call is made at the compile time.  In other words, binding is performed at compile time.  Though static binding makes the program efficient and faster but the flexibility of the program the becomes poor.  
In Dynamic binding, the linking of function call to the code of the function to be executed in response to the function call is made at run time.  The code of the function to be linked with function call is unknown until it is executed.
ADVANTAGES OF OBJECT ORIENTED PROGRAMMING APPROACH 
The Object Oriented Programming is dramatic innovation in software development in last decade.  It ranks its importance with the development among the first higher level languages at the dawn of the computer age.  The main problem with computer programs is complexity.  Large programs are probably the most complicated entities ever created by humans.  This leads to complexity that can cause errors which are difficult to locate and remove.  Object-Oriented Programming (OOP) eliminates many flaws associated with the traditional programming approach and offers a new and powerful way to cope up with the complexity.  Its goal is to make clearer, more reliable and good quality software.  OOP promises to make applications that can stay around for a longer time without problems and can easily be maintained and extended.  There are many advantages of OOP approach which are explained as follows:
1. Object Oriented Programming (OOP) lays more emphasis on data rather than functions and does not allow data of an object to be accessed freely in the system.  This concept is supported by data hiding which provides greater system security and avoids unintended data corruption.  
2. OOP provides a clear modular structure for programs which makes it good for defining abstract data types (ADT) using Abstraction.  Abstraction provides benefits both to the user as well as programmer of the class.  The user benefits as it interacts with the class using well defined interfaces (function names) without knowing the complex internal implementation details of the class.  The programmer takes advantage by modifying the internal logic of the function without changing the interface. 
3. OOP is well suited for modelling real world problems as close as possible to the user's perspective.  The concept of objects help in trapping the human's thought in programming.  
4. Objects communicate with each other through well defined interfaces using the concept of message passing.  It provides proper integration of the system that helps the programmer to solve complex problems very easily.  It also maximize reusability, reduces data dependency and minimize debugging time.  
5. Using the concept of Inheritance, redundant program code can be eliminated and user can use already defined classes.  It ensures more accurate coding, higher productivity and minimize development cost and time.  
6. OOPs offers the possibility of writing the code once and then reusing that code over and over again.  The definition of class is reusable not only by the program for which it is initially being created but also by the other object oriented program and for this reason it can be distributed for use over the networks.  Reusability of code improves the quality of software because writing new code may result in additional bugs which can be minimized by reusing the existing compiled and tested code.  
7. Dividing a complex problem into small self contained (independent) objects makes locating and removing bugs in an easy way with less impact on the overall system.  Since related code and data is encapsulated in the object so it is easier for the maintenance people to find what they are looking for in one place.  This improves the maintenance of the whole system.  
8. An object oriented system uses encapsulation, data hiding, data abstraction and methods of communication between objects are properly defined, so the system can be understood very easily. 
9. Object Oriented Systems are easily extensible as new classes can easily be added with little or no modification  in the existing system.  
10. The concept of classes in Object Oriented Programming allows a programmer to create any new complex data type that is not already defined in the language itself 
11. OOP provide a good framework for rich set of code libraries where supplied software components can easily be adapted  and modified by the programmer.  It helps in rapid development of programs. 
 12. OOPs provide the facility to coexist the multiple objects without any interference.
DISADVANTAGES OF OBJECT ORIENTED APPROACH 
Although Object Oriented Programming approach has many advantages but still it suffers from the following disadvantages: 
1. It is very difficult to understand the flow of control during the execution of a complex object oriented system.  
2. OOP is no more a flamboyant toy but a set of useful concepts which if not understood properly will simply end up as a use of simple object oriented concepts without any benefits.
3. It is hard, takes time and requires commitment and experience to build complex object oriented applications.  
4. Object oriented programing is more suitable for managing large and complex software applications and not for making smaller software applications.  
5. The run time overhead of dynamic binding mechanism is major disadvantage of object oriented languages.  
6. Object Oriented Programming is domain centered and knowledge (information) intensive.
APPLICATIONS OF OOPS 
Object Oriented Programming (OOP) is a new way of solving complex system that has created lot of excitement and interest among software engineers.  The software developed using Object Oriented Programming are reliable, efficient, easily extended and modified.  OOP is not only a way of programming but also a way of thinking abstractly about a problem using real world concepts rather than computer concepts.  The applications of OOP are beginning to emerge in different areas.  The OOP technology is becoming important in many areas of computer science including programming, user interface, CAD (Computer Aided Design) system, Database system, Graphics, Application integration platform, Network management architecture and in Distributed systems.  
The most common application area of OOP is GUI (Graphical User Interface) like Windows.  Many window systems have been developed using OOP technology.  We can also develop editors using Object Oriented Programming.  OOP in combination with RDBMS can be used for developing Object Oriented Relational Database Management System (OORDBMS).
Following are some of the applications of OOP: 
Real - time systems 
Object Oriented Relational Database Management System (OORDBMS) 
Artificial Intelligence and Expert System 
CAD / CAM  
System Software 
Office Automation System 
Neural Networks 
Parallel Programming 
Simulation and Modelling 
Image Processing System 
Graphical user Interface 
Multimedia  Applications 
Network Management System and Distributed System 
Computer based Training and Educational Systems
The concept of OOP is not only used in Object Oriented Programming languages but also used to design and analyse complex systems.  The OOP technology improves the quality of software system as well as increase the reliability and productivity of the system.  
In the near future all the newly designed operating systems and development tools will use Object Oriented technology in most of the applications.

No comments

Powered by Blogger.