SlideShare une entreprise Scribd logo
1  sur  35
1
Object Oriented Programming
Development
By:
Anoop Gupta
SoftEra Informative
C-DAC Training
Email:
softera.informative@gmail.c
om
Oops ?
Object oriented programming is a
programming paradigm which uses
objects and its interactions to design
applications and computer programs.
Simula67 was the first object-oriented
programming language. Java, Python, C+
+, Visual Basic .NET and Ruby are the
most popular OOP languages today.
2
Oops Features ?
Class
Object
Encapsulation
Abstraction
Polymorphism
Inheritance
3
Class ?
Classes are user-defined (programmer-
defined) types.
Data (data members)
Functions (member functions or methods)
In other words, they are structures +
functions
Classes are logical entity which defines
behaviors and property for Object
4
Class
Examples -
•Animals
•Human
•Books
•Cricketer 5
Classes in C++
A class definition begins with the keyword
class.
The body of the class is contained within a
set of braces, { } ; (notice the semi-colon)
6
Class class_Name
{ ………
………
……..
};
Any valid identifier
Class body (data
member + methodsmethods)
Object ?
Object is a real time entity which exist
physically
Object occupy some space into memory
Every object have some specific property
and behavior but all objects from the
same class share common property and
behavior
7
Objects ?
•Animals
8
9
What are we doing today?
Introduction of:
the lecturer
Objects
Basic Terminology
C++
the module
Object
Fruits
10
Abstraction ?
Abstraction is another good feature of
OOPS. Abstraction means to show only
the necessary details to the client of the
object.
Abstraction says that hide un necessary
detail from the user which are not required
them
11
Abstraction
Abstraction
12
Encapsulation
Encapsulation is a process of binding or
wrapping the data and the codes that
operates on the data into a single entity.
This keeps the data safe from outside
interface and misuse.
Encapsulation Provide data security .
13
Encapsulation
Encapsulation defines the access levels
for elements of that class. These access
levels define the access rights to the data,
allowing us to access the data by a
method of that particular class itself, from
aninheritance class, or even from any
other class. There are three levels of
access:
14
Encapsulation
– Encapsulation
15
Polymorphism
16
17
What is Object Oriented
Programming?
An object is like a
black box.
The internal
details are
hidden.
Identifying objects and
assigning responsibilities to
these objects.
Objects communicate to
other objects by sending
messages.
Messages are received by
the methods of an object
18
What is an object?
Tangible Things as a car, printer, ...
Roles as employee, boss, ...
Incidents as flight, overflow, ...
Interactions as contract, sale, ...
Specifications as colour, shape, …
19
So, what are objects?
an object represents an individual,
identifiable item, unit, or entity, either real
or abstract, with a well-defined role in the
problem domain.
Or
An "object" is anything to which a concept
applies.
Etc.
20
Why do we care about
objects?
Modularity - large software projects
can be split up in smaller pieces.
Reuseability - Programs can be
assembled from pre-written software
components.
Extensibility - New software
components can be written or
developed from existing ones.
Example: The Person class
#include<string>
#include<iostream>
class Person{
char name[20];
int yearOfBirth;
public:
void displayDetails() {
cout << name << " born in "
<< yearOfBirth << endl;
}
//...
};
private
data
public
processes
22
The two parts of an object
Object = Data + Methods
or to say the same differently:
An object has the responsibility to know and
the responsibility to do.
= +
23
Basic Terminology
Abstraction is the representation of the
essential features of an object. These are
‘encapsulated’ into an abstract data type.
Encapsulation is the practice of including
in an object everything it needs hidden
from other objects. The internal state is
usually not accessible by other objects.
24
Basic Terminology:
Inheritance
Inheritance means that one class inherits
the characteristics of another class.
This is also called a “is a” relationship:
A car is a vehicle
A teacher is a person
A dog is an animal
25
Basic Terminology:
Polymorphism
Polymorphism means “having many
forms”. It allows different objects to
respond to the same message in different
ways, the response specific to the type of
the object.
E.g. the message displayDetails() of the
Person class should give different
results when send to a Student object
(e.g. the enrolment number).
26
Basic Terminology:
Aggregation
Aggregation describes a “has a”
relationship. One object is a part of
another object.
We distinguish between composite
aggregation (the composite “owns” the
part) and shared aggregation (the part is
shared by more then one composite).
A car has wheels.
27
Basic Terminology:
Behaviour and Messages
The most important aspect of an object is
its behaviour (the things it can do). A
behaviour is initiated by sending a
message to the object (usually by calling
a method).
28
The two steps of Object
Oriented Programming
Making Classes: Creating, extending or
reusing abstract data types.
Making Objects interact: Creating objects
from abstract data types and defining their
relationships.
29
Historical Notes
C++ owes most to C.
Other ancestors are Simula67
and Algol68.
First versions of C++ in 1980 under the
name “C with classes”. Since 1983 the
name C++ is used.
1990: ANSI/ISO 9899 defines a standard
for C
1998: ISO/IEC 14882 specifies the
standard for C++
C++ 1987
30
C++ and C
C is a subset of C++.
Advantages: Existing C libraries can be
used, efficient code can be generated.
But: C++ has the same caveats and
problems as C (e.g. pointer arithmetic,…).
C++ can be used both as a low level and
as a high level language.
We focus on the
high level aspects.
31
C++ and Java
Java is a full object oriented language, all
code has to go into classes.
C++ - in contrast - is a hybrid language,
capable both of functional and object
oriented programming.
So, C++ is more powerful but also
more difficult to handle than Java.
32
Module Outline
Introduction
The non object
oriented basics
Classes
Design Approaches
Testing
Inheritance
Aggregation
Polymorphism
Multifile Development
33
Assessment Details
50% in course and 50% exam.
For more details for the in course
assignment see separate handout.
34
Books
Teach Yourself C++ in 10 minutes,
J. Liberty, SAMS 1999.
C++ - How to program, Deitel & Deitel,
Prentice Hall, 2001.
Object Oriented Programming with C++,
David Parson, Letts Educational, London
1997.
35
Websites
A C++ online tutorial:
http://www.cplusplus.com/doc/tutorial/
The C++ FAQ:
http://www.parashift.com/c++-faq-lite
The homepage of Bjarne Stroustrup, the
inventor of C++:
http://www.research.att.com/~bs
And many, many more!

Contenu connexe

Tendances

Object Oriented Programming using C++ Part II
Object Oriented Programming using C++ Part IIObject Oriented Programming using C++ Part II
Object Oriented Programming using C++ Part IIAjit Nayak
 
Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)Nuzhat Memon
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts246paa
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]Rome468
 
Learn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & MethodsLearn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & MethodsEng Teong Cheah
 
C# programming : Chapter One
C# programming : Chapter OneC# programming : Chapter One
C# programming : Chapter OneKhairi Aiman
 
Object Oriented Programming with C#
Object Oriented Programming with C#Object Oriented Programming with C#
Object Oriented Programming with C#foreverredpb
 
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
OBJECT ORIENTED ROGRAMMING With Question And Answer  FullOBJECT ORIENTED ROGRAMMING With Question And Answer  Full
OBJECT ORIENTED ROGRAMMING With Question And Answer FullManas Rai
 
Very short OOP Introduction
Very short OOP IntroductionVery short OOP Introduction
Very short OOP IntroductionCristian G
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop Kumar
 
Advanced Language Technologies for Mathematical Markup
Advanced Language Technologies for Mathematical MarkupAdvanced Language Technologies for Mathematical Markup
Advanced Language Technologies for Mathematical MarkupOlga Caprotti
 

Tendances (20)

Object Oriented Programming using C++ Part II
Object Oriented Programming using C++ Part IIObject Oriented Programming using C++ Part II
Object Oriented Programming using C++ Part II
 
Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]
 
Four Pillers Of OOPS
Four Pillers Of OOPSFour Pillers Of OOPS
Four Pillers Of OOPS
 
Learn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & MethodsLearn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & Methods
 
2 Object Oriented Programming
2 Object Oriented Programming2 Object Oriented Programming
2 Object Oriented Programming
 
C# programming : Chapter One
C# programming : Chapter OneC# programming : Chapter One
C# programming : Chapter One
 
Birasa 1
Birasa 1Birasa 1
Birasa 1
 
JAVA PROGRAMMINGD
JAVA PROGRAMMINGDJAVA PROGRAMMINGD
JAVA PROGRAMMINGD
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
 
Object Oriented Programming with C#
Object Oriented Programming with C#Object Oriented Programming with C#
Object Oriented Programming with C#
 
Oop ppt
Oop pptOop ppt
Oop ppt
 
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
OBJECT ORIENTED ROGRAMMING With Question And Answer  FullOBJECT ORIENTED ROGRAMMING With Question And Answer  Full
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
 
Ah java-ppt2
Ah java-ppt2Ah java-ppt2
Ah java-ppt2
 
Classroom Object Oriented Language (COOL)
Classroom Object Oriented Language (COOL)Classroom Object Oriented Language (COOL)
Classroom Object Oriented Language (COOL)
 
Very short OOP Introduction
Very short OOP IntroductionVery short OOP Introduction
Very short OOP Introduction
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop
 
Java
JavaJava
Java
 
Advanced Language Technologies for Mathematical Markup
Advanced Language Technologies for Mathematical MarkupAdvanced Language Technologies for Mathematical Markup
Advanced Language Technologies for Mathematical Markup
 

En vedette

Ace enablers energy saving machine uptime-harmonic mitigation
Ace enablers energy saving machine uptime-harmonic mitigationAce enablers energy saving machine uptime-harmonic mitigation
Ace enablers energy saving machine uptime-harmonic mitigationSrinivasan Jeyaram
 
POWER HARMONICS- SOURCES, ISSUES AND MITIGATION
POWER HARMONICS- SOURCES, ISSUES AND MITIGATIONPOWER HARMONICS- SOURCES, ISSUES AND MITIGATION
POWER HARMONICS- SOURCES, ISSUES AND MITIGATIONASHIKS842
 
Harmonic waves
Harmonic wavesHarmonic waves
Harmonic wavesAlison Wu
 
Harmonics and mitigation techniques
Harmonics and mitigation techniquesHarmonics and mitigation techniques
Harmonics and mitigation techniquesrifat maryum
 
Harmonics mitigation solutions
Harmonics mitigation solutionsHarmonics mitigation solutions
Harmonics mitigation solutionsFahad Shaikh
 
Harmonics: Causes and Effects
Harmonics: Causes and EffectsHarmonics: Causes and Effects
Harmonics: Causes and EffectsLeonardo ENERGY
 
harmonic distortion ppt
harmonic distortion pptharmonic distortion ppt
harmonic distortion pptAditi Tiwari
 
Harmonics in power system
Harmonics in power systemHarmonics in power system
Harmonics in power systemMinh Anh Nguyen
 
MicroGrid and Energy Storage System COMPLETE DETAILS NEW PPT
MicroGrid and Energy Storage System COMPLETE DETAILS NEW PPTMicroGrid and Energy Storage System COMPLETE DETAILS NEW PPT
MicroGrid and Energy Storage System COMPLETE DETAILS NEW PPT Abin Baby
 
Microgrid Presentation
Microgrid PresentationMicrogrid Presentation
Microgrid PresentationShahab Khan
 

En vedette (15)

Ace enablers energy saving machine uptime-harmonic mitigation
Ace enablers energy saving machine uptime-harmonic mitigationAce enablers energy saving machine uptime-harmonic mitigation
Ace enablers energy saving machine uptime-harmonic mitigation
 
Harmonics
HarmonicsHarmonics
Harmonics
 
POWER HARMONICS- SOURCES, ISSUES AND MITIGATION
POWER HARMONICS- SOURCES, ISSUES AND MITIGATIONPOWER HARMONICS- SOURCES, ISSUES AND MITIGATION
POWER HARMONICS- SOURCES, ISSUES AND MITIGATION
 
Harmonic waves
Harmonic wavesHarmonic waves
Harmonic waves
 
Harmonics and mitigation techniques
Harmonics and mitigation techniquesHarmonics and mitigation techniques
Harmonics and mitigation techniques
 
Harmonics mitigation solutions
Harmonics mitigation solutionsHarmonics mitigation solutions
Harmonics mitigation solutions
 
Ps harmonics
Ps harmonicsPs harmonics
Ps harmonics
 
Hormonics impact and_mitigation
Hormonics impact and_mitigationHormonics impact and_mitigation
Hormonics impact and_mitigation
 
Harmonics: Causes and Effects
Harmonics: Causes and EffectsHarmonics: Causes and Effects
Harmonics: Causes and Effects
 
Simple harmonic motion
Simple harmonic motionSimple harmonic motion
Simple harmonic motion
 
harmonic distortion ppt
harmonic distortion pptharmonic distortion ppt
harmonic distortion ppt
 
Harmonics in power system
Harmonics in power systemHarmonics in power system
Harmonics in power system
 
Microgrid
MicrogridMicrogrid
Microgrid
 
MicroGrid and Energy Storage System COMPLETE DETAILS NEW PPT
MicroGrid and Energy Storage System COMPLETE DETAILS NEW PPTMicroGrid and Energy Storage System COMPLETE DETAILS NEW PPT
MicroGrid and Energy Storage System COMPLETE DETAILS NEW PPT
 
Microgrid Presentation
Microgrid PresentationMicrogrid Presentation
Microgrid Presentation
 

Similaire à Week1

Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Languagedheva B
 
SE_Lec 06_Object Oriented Analysis and Design
SE_Lec 06_Object Oriented Analysis and DesignSE_Lec 06_Object Oriented Analysis and Design
SE_Lec 06_Object Oriented Analysis and DesignAmr E. Mohamed
 
SE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and DesignSE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and DesignAmr E. Mohamed
 
1 intro
1 intro1 intro
1 introabha48
 
1207028 634528828886611250
1207028 6345288288866112501207028 634528828886611250
1207028 634528828886611250Akhil Nama
 
Oop.concepts
Oop.conceptsOop.concepts
Oop.conceptstahir266
 
Object oriented programming C++
Object oriented programming C++Object oriented programming C++
Object oriented programming C++AkshtaSuryawanshi
 
OO Development 4 - Object Concepts
OO Development 4 - Object ConceptsOO Development 4 - Object Concepts
OO Development 4 - Object ConceptsRandy Connolly
 
Chapter 1- Introduction.ppt
Chapter 1- Introduction.pptChapter 1- Introduction.ppt
Chapter 1- Introduction.pptTigistTilahun1
 
Object And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) LanguagesObject And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) LanguagesJessica Deakin
 
c++session 1.pptx
c++session 1.pptxc++session 1.pptx
c++session 1.pptxPadmaN24
 
C++ largest no between three nos
C++ largest no between three nosC++ largest no between three nos
C++ largest no between three noskrismishra
 
CPP_,module2_1.pptx
CPP_,module2_1.pptxCPP_,module2_1.pptx
CPP_,module2_1.pptxAbhilashTom4
 

Similaire à Week1 (20)

Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
 
C++ interview question
C++ interview questionC++ interview question
C++ interview question
 
SE_Lec 06_Object Oriented Analysis and Design
SE_Lec 06_Object Oriented Analysis and DesignSE_Lec 06_Object Oriented Analysis and Design
SE_Lec 06_Object Oriented Analysis and Design
 
SE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and DesignSE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and Design
 
1 intro
1 intro1 intro
1 intro
 
1207028 634528828886611250
1207028 6345288288866112501207028 634528828886611250
1207028 634528828886611250
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
 
Oop.concepts
Oop.conceptsOop.concepts
Oop.concepts
 
Object oriented programming C++
Object oriented programming C++Object oriented programming C++
Object oriented programming C++
 
Java pdf
Java   pdfJava   pdf
Java pdf
 
OO Development 4 - Object Concepts
OO Development 4 - Object ConceptsOO Development 4 - Object Concepts
OO Development 4 - Object Concepts
 
Chapter 1- Introduction.ppt
Chapter 1- Introduction.pptChapter 1- Introduction.ppt
Chapter 1- Introduction.ppt
 
Object And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) LanguagesObject And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) Languages
 
Java chapter 3
Java   chapter 3Java   chapter 3
Java chapter 3
 
c++session 1.pptx
c++session 1.pptxc++session 1.pptx
c++session 1.pptx
 
JAVA PROGRAMMING
JAVA PROGRAMMING JAVA PROGRAMMING
JAVA PROGRAMMING
 
C++ largest no between three nos
C++ largest no between three nosC++ largest no between three nos
C++ largest no between three nos
 
Mca 504 dotnet_unit3
Mca 504 dotnet_unit3Mca 504 dotnet_unit3
Mca 504 dotnet_unit3
 
CPP_,module2_1.pptx
CPP_,module2_1.pptxCPP_,module2_1.pptx
CPP_,module2_1.pptx
 

Plus de Siya Agarwal

Whats digital marketing
Whats digital marketingWhats digital marketing
Whats digital marketingSiya Agarwal
 
amrapali la residentia
amrapali la residentiaamrapali la residentia
amrapali la residentiaSiya Agarwal
 
Solar home lighting system
Solar home lighting systemSolar home lighting system
Solar home lighting systemSiya Agarwal
 
Solar charge controller
Solar charge controllerSolar charge controller
Solar charge controllerSiya Agarwal
 
Presentation on venturi
Presentation on venturiPresentation on venturi
Presentation on venturiSiya Agarwal
 
Presentation on sparkler filter bag
Presentation on sparkler filter bagPresentation on sparkler filter bag
Presentation on sparkler filter bagSiya Agarwal
 
Presentation on screening mesh
Presentation on screening meshPresentation on screening mesh
Presentation on screening meshSiya Agarwal
 
Presentation on reverse air type filter bag
Presentation on reverse air type filter bagPresentation on reverse air type filter bag
Presentation on reverse air type filter bagSiya Agarwal
 
Presentation on pulveriser sleeve
Presentation on pulveriser sleevePresentation on pulveriser sleeve
Presentation on pulveriser sleeveSiya Agarwal
 
Presentation on pp cartridge housing filter
Presentation on pp cartridge housing filterPresentation on pp cartridge housing filter
Presentation on pp cartridge housing filterSiya Agarwal
 
Presentation on nutsche filter bag
Presentation on nutsche filter bagPresentation on nutsche filter bag
Presentation on nutsche filter bagSiya Agarwal
 
Presentation on geotextile
Presentation on geotextilePresentation on geotextile
Presentation on geotextileSiya Agarwal
 
Presentation on fine bubble diffuser
Presentation on fine bubble diffuserPresentation on fine bubble diffuser
Presentation on fine bubble diffuserSiya Agarwal
 
Presentation on FBD filter bags
Presentation on FBD filter bagsPresentation on FBD filter bags
Presentation on FBD filter bagsSiya Agarwal
 
Presentation on candle filter bag
Presentation on candle filter bagPresentation on candle filter bag
Presentation on candle filter bagSiya Agarwal
 
Presentation on waste water diffuser
Presentation on waste water diffuserPresentation on waste water diffuser
Presentation on waste water diffuserSiya Agarwal
 
Presentation on support cages
Presentation on support cagesPresentation on support cages
Presentation on support cagesSiya Agarwal
 

Plus de Siya Agarwal (20)

Whats digital marketing
Whats digital marketingWhats digital marketing
Whats digital marketing
 
amrapali la residentia
amrapali la residentiaamrapali la residentia
amrapali la residentia
 
Anode filter bags
Anode filter bagsAnode filter bags
Anode filter bags
 
Pmp west delhi
Pmp west delhiPmp west delhi
Pmp west delhi
 
Solar home lighting system
Solar home lighting systemSolar home lighting system
Solar home lighting system
 
Solar off grid
Solar off gridSolar off grid
Solar off grid
 
Solar charge controller
Solar charge controllerSolar charge controller
Solar charge controller
 
Presentation on venturi
Presentation on venturiPresentation on venturi
Presentation on venturi
 
Presentation on sparkler filter bag
Presentation on sparkler filter bagPresentation on sparkler filter bag
Presentation on sparkler filter bag
 
Presentation on screening mesh
Presentation on screening meshPresentation on screening mesh
Presentation on screening mesh
 
Presentation on reverse air type filter bag
Presentation on reverse air type filter bagPresentation on reverse air type filter bag
Presentation on reverse air type filter bag
 
Presentation on pulveriser sleeve
Presentation on pulveriser sleevePresentation on pulveriser sleeve
Presentation on pulveriser sleeve
 
Presentation on pp cartridge housing filter
Presentation on pp cartridge housing filterPresentation on pp cartridge housing filter
Presentation on pp cartridge housing filter
 
Presentation on nutsche filter bag
Presentation on nutsche filter bagPresentation on nutsche filter bag
Presentation on nutsche filter bag
 
Presentation on geotextile
Presentation on geotextilePresentation on geotextile
Presentation on geotextile
 
Presentation on fine bubble diffuser
Presentation on fine bubble diffuserPresentation on fine bubble diffuser
Presentation on fine bubble diffuser
 
Presentation on FBD filter bags
Presentation on FBD filter bagsPresentation on FBD filter bags
Presentation on FBD filter bags
 
Presentation on candle filter bag
Presentation on candle filter bagPresentation on candle filter bag
Presentation on candle filter bag
 
Presentation on waste water diffuser
Presentation on waste water diffuserPresentation on waste water diffuser
Presentation on waste water diffuser
 
Presentation on support cages
Presentation on support cagesPresentation on support cages
Presentation on support cages
 

Dernier

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Dernier (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Week1

  • 1. 1 Object Oriented Programming Development By: Anoop Gupta SoftEra Informative C-DAC Training Email: softera.informative@gmail.c om
  • 2. Oops ? Object oriented programming is a programming paradigm which uses objects and its interactions to design applications and computer programs. Simula67 was the first object-oriented programming language. Java, Python, C+ +, Visual Basic .NET and Ruby are the most popular OOP languages today. 2
  • 4. Class ? Classes are user-defined (programmer- defined) types. Data (data members) Functions (member functions or methods) In other words, they are structures + functions Classes are logical entity which defines behaviors and property for Object 4
  • 6. Classes in C++ A class definition begins with the keyword class. The body of the class is contained within a set of braces, { } ; (notice the semi-colon) 6 Class class_Name { ……… ……… …….. }; Any valid identifier Class body (data member + methodsmethods)
  • 7. Object ? Object is a real time entity which exist physically Object occupy some space into memory Every object have some specific property and behavior but all objects from the same class share common property and behavior 7
  • 9. 9 What are we doing today? Introduction of: the lecturer Objects Basic Terminology C++ the module
  • 11. Abstraction ? Abstraction is another good feature of OOPS. Abstraction means to show only the necessary details to the client of the object. Abstraction says that hide un necessary detail from the user which are not required them 11
  • 13. Encapsulation Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. Encapsulation Provide data security . 13
  • 14. Encapsulation Encapsulation defines the access levels for elements of that class. These access levels define the access rights to the data, allowing us to access the data by a method of that particular class itself, from aninheritance class, or even from any other class. There are three levels of access: 14
  • 17. 17 What is Object Oriented Programming? An object is like a black box. The internal details are hidden. Identifying objects and assigning responsibilities to these objects. Objects communicate to other objects by sending messages. Messages are received by the methods of an object
  • 18. 18 What is an object? Tangible Things as a car, printer, ... Roles as employee, boss, ... Incidents as flight, overflow, ... Interactions as contract, sale, ... Specifications as colour, shape, …
  • 19. 19 So, what are objects? an object represents an individual, identifiable item, unit, or entity, either real or abstract, with a well-defined role in the problem domain. Or An "object" is anything to which a concept applies. Etc.
  • 20. 20 Why do we care about objects? Modularity - large software projects can be split up in smaller pieces. Reuseability - Programs can be assembled from pre-written software components. Extensibility - New software components can be written or developed from existing ones.
  • 21. Example: The Person class #include<string> #include<iostream> class Person{ char name[20]; int yearOfBirth; public: void displayDetails() { cout << name << " born in " << yearOfBirth << endl; } //... }; private data public processes
  • 22. 22 The two parts of an object Object = Data + Methods or to say the same differently: An object has the responsibility to know and the responsibility to do. = +
  • 23. 23 Basic Terminology Abstraction is the representation of the essential features of an object. These are ‘encapsulated’ into an abstract data type. Encapsulation is the practice of including in an object everything it needs hidden from other objects. The internal state is usually not accessible by other objects.
  • 24. 24 Basic Terminology: Inheritance Inheritance means that one class inherits the characteristics of another class. This is also called a “is a” relationship: A car is a vehicle A teacher is a person A dog is an animal
  • 25. 25 Basic Terminology: Polymorphism Polymorphism means “having many forms”. It allows different objects to respond to the same message in different ways, the response specific to the type of the object. E.g. the message displayDetails() of the Person class should give different results when send to a Student object (e.g. the enrolment number).
  • 26. 26 Basic Terminology: Aggregation Aggregation describes a “has a” relationship. One object is a part of another object. We distinguish between composite aggregation (the composite “owns” the part) and shared aggregation (the part is shared by more then one composite). A car has wheels.
  • 27. 27 Basic Terminology: Behaviour and Messages The most important aspect of an object is its behaviour (the things it can do). A behaviour is initiated by sending a message to the object (usually by calling a method).
  • 28. 28 The two steps of Object Oriented Programming Making Classes: Creating, extending or reusing abstract data types. Making Objects interact: Creating objects from abstract data types and defining their relationships.
  • 29. 29 Historical Notes C++ owes most to C. Other ancestors are Simula67 and Algol68. First versions of C++ in 1980 under the name “C with classes”. Since 1983 the name C++ is used. 1990: ANSI/ISO 9899 defines a standard for C 1998: ISO/IEC 14882 specifies the standard for C++ C++ 1987
  • 30. 30 C++ and C C is a subset of C++. Advantages: Existing C libraries can be used, efficient code can be generated. But: C++ has the same caveats and problems as C (e.g. pointer arithmetic,…). C++ can be used both as a low level and as a high level language. We focus on the high level aspects.
  • 31. 31 C++ and Java Java is a full object oriented language, all code has to go into classes. C++ - in contrast - is a hybrid language, capable both of functional and object oriented programming. So, C++ is more powerful but also more difficult to handle than Java.
  • 32. 32 Module Outline Introduction The non object oriented basics Classes Design Approaches Testing Inheritance Aggregation Polymorphism Multifile Development
  • 33. 33 Assessment Details 50% in course and 50% exam. For more details for the in course assignment see separate handout.
  • 34. 34 Books Teach Yourself C++ in 10 minutes, J. Liberty, SAMS 1999. C++ - How to program, Deitel & Deitel, Prentice Hall, 2001. Object Oriented Programming with C++, David Parson, Letts Educational, London 1997.
  • 35. 35 Websites A C++ online tutorial: http://www.cplusplus.com/doc/tutorial/ The C++ FAQ: http://www.parashift.com/c++-faq-lite The homepage of Bjarne Stroustrup, the inventor of C++: http://www.research.att.com/~bs And many, many more!