Skip to main content

Oop's Concept

.Net is purely object oriented Language because it strongly support four major pillars  object oriented language.

  four Major Pillars are : -

     1) Abstraction.
     2) Encapsulation
     3) Inheritance
     4) Polymorphism

.Net  also support three minor pillars : -

    1) Strongly Type Cast
    2) Persistent
    3) Concurrency


*** ABSTRACTION ***

      In simple words  “Abstraction captures only those details about an object that are relevant to the current perspective.”

 In object-oriented programming theory, abstraction involves the facility to define objects that represent abstract “actors” that can perform work, report on and change their state, and “communicate” with other objects in the system. Abstraction is a concept which hide complexity.
*** ENCAPSULATION ***

    Encapsulation is the ability to package data, related behavior in an object bundle and control/restrict access to them (both data and function) from other objects. It is all about packaging related stuff together and hide them from external elements .

        We can see that keywords encapsulation and data hiding are used synonymously everywhere. It should not be misunderstood that encapsulation is all about data hiding only. When we say encapsulation, emphasis should be on grouping or packaging or bundling related data and behavior together.

*** INHERITANCE ***
Inheritance can be defined as the process where one object acquires the properties of another. With the use of inheritance the information is made manageable in a hierarchical order
        Different kinds of objects often have a certain amount in common with each other. Mountain bikes, road bikes, and tandem bikes, for example, all share the characteristics of bicycles (current speed, current pedal cadence, current gear). Yet each also defines additional features that make them different: tandem bicycles have two seats and two sets of handlebars; road bikes have drop handlebars; some mountain bikes have an additional chain ring, giving them a lower gear ratio.

*** Poly-Morphism ****
Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object.
 By using poly-morphism we can implement Method-overLoading and Method-overRiding

Comments

Popular posts from this blog

Session 3 :- Control Structures in c#

Date Friday, November 29, 2013 Time Description 10.00 am to 12.00 pm Control structure in c# Learning :   For Loops Why is this important to learn about? Control structures are one of the most fundamental concepts in any programming language you will come across. If you want to know C#, and if you want to learn to program with any language, you must have a firm grip on the control structures of the language. Definitions of terms used . Iteration – This is the act of repeating something (that ‘something’ being code statements in the programming context). Conditional – A conditional action is said to be one that is only performed if a certain condition is true. For Loops For loops allow us to specify the number of times to repeat a block of code. It is best demonstrated with an example: for (int i = 1; i <= 5; i++) {    Console...

Inheritance in c#

Inheritance is one of the pillars of Object Oriented Programming. It allows the child class to reuse, extend and modify the behavior of parent class. The class whose members are inherited is called as base class and class who inherits is called a derived class. We can inherit only one class at a time. Multiple inheritance is not supported in c#. A struct cannot inherit any base class doing so will generate a compiler error. 1.       Private members are only accessible to the derived class which is nested in the inherited base class. 2.       Protected members are accessible only in derived class. 3.       Internal members are accessible in the derived class that is visible in the same assembly of the base class. 4.       Public members are accessible in the derived class. They can be called just as if they were declared in the derived class. All Types are implicitly inherited ...