alt
Advertisement
Sponsored links
Online Training
Career Series
Exforsys
Exforsys arrow Tutorials arrow C Plus Plus arrow Object Oriented Programming Paradigm
Site Search


Object Oriented Programming Paradigm

Object Oriented Programming Paradigm

Oops is a better way of solving problems in computers compared to the procedural language programming such as in C. oops is designed around the data being operated upon as opposed to the operations, these operations are designed to fit data.

A type of programming in which programmers define not only the data type of a data structure, but also the types of operations that can be applied to the data structure. In this way, the data structure becomes an object that includes both data and functions. In addition, programmers can create relationships between one object and another. For example, objects can inherit characteristics from other objects.

One of the principal advantages of object-oriented programming techniques over procedural programming techniques is that they enable programmers to create modules that do not need to be changed when a new type of object is added. A programmer can simply create a new object that inherits many of its features from existing objects. This makes object-oriented programs easier to modify.

To perform object-oriented programming, one needs an object-oriented programming language such as Java C++ etc.

The C++ programming language provides a model of memory and computation that closely matches that of most computers. In addition, it provides powerful and flexible mechanisms for abstraction; that is, language constructs that allow the programmer to introduce and use new types of objects that match the concepts of an application.

Thus, C++ supports styles of programming that rely on fairly direct manipulation of hardware resources to deliver a high degree of efficiency plus higher-level styles of programming that rely on user-defined types to provide a model of data and computation that is closer to a human’s view of the task being performed by a computer. These higher-level styles of programming are often called data abstraction, object-oriented programming, and generic programming.

Features of OOPs are the following:

  • Encapsulation
  • Data abstraction
  • Inheritance
  • Polymorphism
  • Message passing
  • Extensibility
  • Persistence
  • Delegation
  • Genericity
  • Multiple Inheritance

In the next tutorial we will discuss about these features.


Trackback(0)
Comments (7)add comment

Manish Madhukar said:

  One Can make More Than one type of class in c . These are
1. Public class 2. Private class 3.friend class
Classes are useful to implement inheritance in C . A child class can contain all the properties i.e. attributes of a
Parent class. More attribute can be added to the child class to make a specialised class of its parent class.
ex: If Bird is a class then crow is a bird having some specific attributes by which it can be identified among other bird categories .
Here in above example bird is a parent class and the crow is a child class. In this way the property of INHERITANCE is implemented in the language of c .
Again, Bird is a case of GENERaLISATION while Crow is a case of SPECIALISATION. In this way DATA MODELING can be done in C .
A class contains its DATA MEMBERS as well as MEMBER FUNCTIONS. Various types of rules can be implemented to take the advantage of ENCAPSULATION. A Data Member is Private or Public or Protected.

INHERITANCE may be SINGLE INHERITANCE of MULTIPLE INHERITANC.
In the Single Inheritance Class can inherit one parent class while in case of MULTIPLE Inheritance class can Inherit more than one Class.
The Visibility of a class is also very important. A class can be a derived class. A Base Class Should be there.
If the BASE CLASS is PRIVATE then 'no' Inheritance can be posible for Derived Class whether it is Public/Protected/Private.
A simple Program is being given To READ and DISPLAY data.
#include
#include
Class EMP
{
Char name[30];
int age;

public:
void getdata(void);
void putdata(void);
};
void EMP :: getdata(void)
{
coutname;
coutage;
void EMP :: putdata(void)
{
cout: "}
void main()
{
EMP mm; /*comment: To Declare a instance of the class EMP. */

mm.getdata();
mm.putdata();

}

output Screen will be :--
Enter Name: Manish
Emter Age : 30

Name: Manish
Age: 30

This is completes the program run once.
July 06, 2006

Manish Madhukar said:

  :'( I have posted some comment yesterday but no new comment is there.
July 08, 2006

Raghunath said:

  Hi Manish...

It is really nice piece of information...The information is short and sweet...

Best regards,
Raghunatjh
June 10, 2007

VInesh said:

  Hi Manish!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

This is really good thing you r doing can you put more focus on classes, objects and methods.

that will really help me...........

Thanks,

Regards,
Vinesh
October 29, 2007

VInesh said:

  Hi Manish!!!!!!!!!!!!!!!!!!!!!

This is really nice thing, it is really easy to understand.
Can you please put more focus on Methods, Classes and objects, it will really help to know more on this.

Thanks,

Regards,
Vinesh
October 29, 2007

praveenjnrbgm said:

  Hi Manish...

It is really nice of information...The information is short and sweet..I realy got some information.

Best regards;
From:PRAVEEN
December 11, 2007

jainy said:

  It is really nice of information...The information is short and sweet..I realy got some information.
December 30, 2007

Write comment

busy
 
< Prev
Exforsys Offers
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape