Sunday 16 February 2014

BASIC CONCEPTS OF OOPS & CLASSES AND OBJECTS

Object-Oriented Programming groups related data and functions together in a class, generally making data private and only some functions public. Restricting access decreases coupling and increases cohesion. It has proven to be very effective in reducing the complexity increase with large programs.For small programs may be difficult to see the advantage of OOP over, eg, structured programming because there is little complexity regardless of how it's written.
It helps in programming approach in order to built robust user friendly and efficient software and provides the efficient way to maintain real world software. OOP is an Object Oriented Programming language which is the extension of Procedure Oriented Programming language. OOPs reduce the
code of the program because of the extensive feature of Polymorphism. OOPs have many properties such as DataHiding, Inheritance Data Abstraction, Data Encapsulation and many more. The main aim is to creating an Object to the Entire program and that to we can control entire program using the Object. The main features of OOPS is Polymorphism, Multiple Inheritance, Abstraction and
Encapsulation.

Object: is the basic unit of object-oriented programming. Objects are identified by its unique name. An object represents a particular instance of a class.
An Object is a collection of data members and associated member functions also known as methods.

Classes:
Classes are data types based on which objects are created.
Thus a Class represents a set of individual objects. Characteristics of an object are represented in a class as Properties. The actions that can be performed by objects become functions of the class and are referred to as Methods.
Classes are the blueprints upon which objects are created. E.g when we design a map of the house, the architect first designs it. Once it is designed, the raw material is used to build the house. In this example, Design of the house is CLASS (blueprint) and the house built on the basis of design is an object.
No memory is allocated when a class is created. Memory is allocated only when an object is created, i.e., when an instance of a class is created.

Inheritance:
Inheritance is the process of forming a new class from an existing class or base class. The base class is also known as parent class or super class. The new class that is formed is called derived class.
 Derived class is also known as a child class or sub class. Inheritance helps in reducing the overall code size of the program, which is an important concept in object-oriented programming. It is the process by which one class inherits the properties of another Class.
Different types of Inheritance are:
1) Single Inheritance
2) Multi level Inheritance
3) Multiple Inheritance
4) Hierarchical Inheritance
5) Hybrid Inheritance

Data Abstraction:
Data Abstraction increases the power of programming language by creating user defined data types.
Data Abstraction also represents the needed information in the program without presenting the details.

The concept of abstraction relates to the idea of hiding data that are not needed for presentation. The
main idea behind data abstraction is to give a clear separation between properties of data type and
the associated implementation details.
An Abstract Data Type is defined as a data type that is defined in terms of the operations that it supports and not in terms of its structure or implementation.

 Data Encapsulation:
 Data Encapsulation combines data and functions into a single unit called class.
 Data Encapsulation enables the important concept of data hiding possible.
 Encapsulation is the process of combining data and functions into a single unit   called class. Using the method of encapsulation, the programmer cannot directly access the data. Data is only accessible through the functions present inside the class.

Data hiding is the implementation details of a class that are hidden from the user. Encapsulation alone is a powerful feature that leads to information hiding, abstract data type and friend functions.


Polymorphism:
Poly means many and morphs mean form, so polymorphism means one name multiple form. There are two types of polymorphism: compile time and run time polymorphism.Polymorphism allows routines to use variables of different types at different times. An operator or function can be given different meanings or functions. Polymorphism refers to a single function or multi-functioning operator performing in different ways .

Overloading:
Overloading is one type of Polymorphism. It allows an object to have different meanings, depending on its context. When an exiting operator or function begins to operate on new data type, or class, it is understood to be overloaded.


Re-usability:
This term refers to the ability for multiple programmers to use the same written and debugged existing class of data.
The programmer can incorporate new features to the existing class, further developing the application and allowing users to achieve increased performance.




No comments:

Post a Comment

Oracle Reserved Words

Oracle  Reserved Words The following words are reserved by Oracle. That is, they have a special meaning to Oracle and so cannot be redefi...