Tuesday, June 18, 2013

OOPS

Let us first clear the basic concepts ...

What is OOP?

understand the object orientation, let’s take your “hand” as an example. The “hand” is a class. Your body has two objects of type hand, named left hand and right hand. Their main functions are controlled/ managed by a set of electrical signals sent through your shoulders (through an interface). So the shoulder is an interface which your body uses to interact with your hands. The hand is a well architected class. The hand is being re-used to create the left hand and the right hand by slightly changing the properties of it.

What is an Object?
An object can be considered a "thing" that can perform a set of related activities. The set of activities that the object performs defines the object's behavior. For example, the hand can grip something or a Student (object) can give the name or address.
In pure OOP terms an object is an instance of a class.
 

What is Class?
 A class is simply a representation of a type of object. It is the blueprint/ plan/ template that describe the details of an object. A class is the blueprint from which the individual objects are created. Class is composed of three things: a name, attributes, and operations.
SYNTAX:

public class Student
{
}
According to the sample given below we can say that the student object, named objectStudent, has created out of the Student class.

Student objectStudent = new Student();

 

Proprties of OOPs

What is Encapsulation (or information hiding)?

Encapsulation is wrapping of data into a single unit. It is the process of keeping state and behavior of the object in a single unit and exposing public methods to act upon the state means hiding internal data of the object from the outside world.
In OOP the encapsulation is mainly achieved by creating classes, the classes expose public methods and properties. The class is kind of a container or capsule or a cell, which encapsulate the set of methods, attribute and properties to provide its indented functionalities to other classes. In that sense, encapsulation also allows a class to change its internal implementation without hurting the overall functioning of the system. That idea of encapsulation is to hide how a class does it but to allow requesting what to do.

There are several other ways that an encapsulation can be used, as an example we can take the usage of an interface. The interface can be used to hide the information of an implemented class.

IStudent myStudent = new LocalStudent();

IStudent myStudent = new ForeignStudent();

According to the sample above (let’s assume that LocalStudent and ForeignStudent are implemented by the IStudent interface) we can see how LocalStudent and ForeignStudent are hiding their, localize implementing information through the IStudent interface.

What is Abstraction ?

Abstraction is the act of identifying the relevant qualities and behaviors an object should possess without representing background details.
The importance of abstraction is derived from its ability to hide irrelevant details and from the use of names to reference objects. Abstraction is essential in the construction of programs. It places the emphasis on what an object is or does rather than how it is represented or how it works. Thus, it is the primary means of managing complexity in large programs.


What is ASP.Net ?

ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites.
ASP.NET allows you to use a full featured programming language such as C# or VB.NET to build web applications easily.

1 comment: