Sunday, January 26, 2014

C# OOP(Object Oriented Programming) Concepts

Object Oriented Programming Concepts

The Key Concepts of Object Oriented Programming are :

  •  Abstraction
  •  Encapsulation
  •  Inheritance
  •  Polymorphism
Concept & Feature : 
  • Concept : Abstraction
    Feature : Natural mapping and association of data and programs or sub-programs   which operate on that data.
  • Concept : Encapsulation
    Feature : Hide or Unhide part of the data or Functionality from some components
  • Concept : Inheritance
    Feature : Extend the functionality for new requirements without disturbing the existing implementation.

==> Difference between Object oriented & Object Based Languages

Object oriented Languages : All programming languages that support abstraction, encapsulation, inheritance and polymorphism are known as Object-Oriented.

Object Based Languages : All programming Languages that support abstraction and encapsulation but do not support inheritance, therefore cannot support polymorphism are known as object based languages. VB and Ada are are Object-Based languages.

What is an Object ?
  • An object is an entity which has a well defined structure and behavior.
  • An Object Possesses certain Characteristics are:
    ==> State
    ==> Behavior
    ==> Identity
    ==> Responsibility
Abstraction :
  •  Abstraction is the Process of identifying the key aspects of an entity and ignoring the rest.
  • Only those aspects are selected that are important to the current problem scenario.
Encapsulation :
  • Encapsulation is a mechanism used to hide the data, internal structure, and implementation details of an object.
  • All interaction with the object is through a public interface of operations.
  • The user knows only about the interface, any changes to the implementation does not affect the user.
Inheritance :
  • The Process of acquiring the Properties of Base class (Parent Class) to the Sub Class (Child Class) is known as Inheritance.
  •  Inheritance is  " is - a " a kind of hierarchy.
Polymorphism : 
  • The ability of different types of related objects to respond to the same message in their own ways is called polymorphism. 
  • Polymorphism helps us to design extensible software, as new objects can be added to the design without rewriting existing procedures.
  • Polymorphism is the ability to take more than one form. This means that one command may invoke different implementation for different related objects.

No comments:

Post a Comment