Monday, September 20, 2010

Object oriented programming features controls||oops properties

Object-oriented programming (OOP) is a programming paradigm that uses “objects” – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, modularity, polymorphism, and inheritance

Class
A Class is template for an object, a user-defined datatype that contains the variables, properties and methods in it. A class defines the abstract characteristics of a thing (object), including its characteristics (its attributes, fields or properties) and the thing’s behaviors (the things it can do, or methods, operations or features).

Instance:

One can have an instance of a class; the instance is the actual object created at run-time. In programmer vernacular, the Lassie object is an instance of the Dog class. The set of values of the attributes of a particular object is called its state. The object consists of state and the behavior that’s defined in the object’s classes.

Method

Method is a set of procedural statements for achieving the desired result. It performs different kinds of operations on different data types.

Message passing

“The process by which an object sends data to another object or asks the other object to invoke a method.”Also known to some programming languages as interfacing.

Inheritance

Inheritance is a process in which a class inherits all the state and behavior of another class. This type of relationship is called child-Parent or is-a relationship. “Subclasses” are more specialized versions of a class, which inherit attributes and behaviors from their parent classes, and can introduce their own.

Abstraction

Abstraction is simplifying complex reality by modeling classes appropriate to the problem, and working at the most appropriate level of inheritance for a given aspect of the problem.

Encapsulation

Encapsulation conceals the functional details of a class from objects that send messages to it.

(Subtype) polymorphism

Polymorphism allows the programmer to treat derived class members just like their parent class’s members.

Decoupling

Decoupling allows for the separation of object interactions from classes and inheritance into distinct layers of abstraction. A common use of decoupling is to polymorphically decouple the encapsulation


No comments:

Post a Comment