Introduction to OOPs

Introduction to C++(oops)

What is OOPs ?

OOPs is a design philosophy. It stands for Object Oriented Programmming
Object Oriented Programmming is paradigm that represents concepts as objects that has data filed and associated prosedures known as methods.
Everything in OOPs is grouped as self sustinable"objects"

Eg:
  • Java
  • Pythan
  • Ruby
  • C++
  • Smalltalk
  • .NET
  • Object C
  • Curl
  • Delphi
  • Eiffel

Objects and Classes

Any real world entity is called object.
The fundemental idea behind object oriented langauage is to combine into a single unit both data and the function that operate on the data.
Such a unit as called an object.
In OOPs we say that object are members of classes.
Class serve as a plan, or blueprint.
It specifies what data and what functions will be included in objectg of that class.

Principles of OOPs(AEIP)

  • Abstraction
  • Encapsulation
  • Inheritance
  • Polymorphism

Abstraction

Abstraction refers to the act of represnpenting essential features without including the background details or explanations.
Abstraction provides you a generalized view of your class or object by providing relevent information.
Abstraction is the process of hiding the working style of an object and showing the information of an object in understandable manner.
Abstraction is a process whare you show only relevent data and hide unnecessary details of an object from the user.
Eg
Collage application form your will fill your details like name, address, DoB, percentage etc.
Hospital patient details you will fill the details like name, address, DoB, blood group, hight etc.
See in the above example what is the thing? Age, name, address, so you can creat the class which consist of common this that is called abstract class.

Encapsulation

The wrapping up of data and functions into a single unit is known as encapsulation.
The insulation of the data from direct access by the program is called data hiding or information hiding.
Eancapsukation is the process of combining data and functions into a simple unit is collect class.
In encapsulation the data is not accessed directly; it is access through the function present inside the class.
Users are unaver about woeking of circuitry and hardware divices.

Inheritance

Inheritance is the process of one class acquire the property of objects of another class.

Polymorphism

Polymorphism means ablity to take more than one form.
For example the operation addition.
For two numbers the operation will generate a sum.
If the operands or string then the operation would produce a third string by concatenation.

Differance between procedural Vs Object Oriented Programming

POP OOPs
Emphasis is on doing things not on data means it is function driven. Emphasis is on data rather than produre means object driven.
Main focus is on the function and procedures that operate on data. main focus is on the data that is being operated.
Top down approch in program design. Bottom up approch in program design.
Large programes are divided in small programs known as function. Large programes are divided into class and objects.
Most of the function chare global data. Data is tied together with function in data structure.
Data move openly in the system from one function to another function. Data is hidden and connect be accessed by external functions.
Adding of data and function is difficult Adding of data and function is eassy
We cannot declare namespace diectly We can use name space in directly.
Ex. using namespace std;
Concept like inheritance, polymorphism, data encapsulation,abstractionaccess specifices are not available. Concept are avaliable, and can be used easily like inheritance, polymorphism, data eancapsulation, abstraction, acess specifies
Ex. c, fortan,paskal, etc Ex. C++, java, C#, etc

Applications of OOPs

Real Time System Design
Simulation and Modeling System.
Object Orient Database
Clien-Server System
Neural Network and Parallal Programming
Decision Support and Office Automation System.
CIM/CAD/CAM SYstem.
AI and Eperts System.