SlideShare a Scribd company logo
Hiding the implementation Because I don't want you to know how I do it Daniel Rodríguez    (Twitter: @sethillgard)
Why? ,[object Object],[object Object],[object Object],[object Object]
Classes ,[object Object],[object Object],[object Object],[object Object]
Controlling access to members ,[object Object],[object Object],[object Object],[object Object]
Example: public ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example: private ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example: mixing public and private ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Protected? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Foo foo; foo.a = 8; //Error! Bar bar; bar.a = 8;  //Error! bar.SetA(8);    //Ok!
Friends ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Notes on friends ,[object Object],[object Object],[object Object]

More Related Content

What's hot

C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
Simplilearn
 
Java adapter
Java adapterJava adapter
Java adapter
Arati Gadgil
 
Understanding Interfaces
Understanding InterfacesUnderstanding Interfaces
Understanding Interfaces
Bhushan Mulmule
 
Friend function OOPC
Friend function OOPCFriend function OOPC
Friend function OOPC
Dhananjaysinh Jhala
 
code analysis for c++
code analysis for c++code analysis for c++
code analysis for c++
Roman Okolovich
 
Java Interface
Java InterfaceJava Interface
Java Interface
Manish Tiwari
 
Total oop in c# dot net
Total oop in c# dot netTotal oop in c# dot net
Total oop in c# dot net
Muhammad Naveed
 
Interfaces in java
Interfaces in javaInterfaces in java
Interfaces in java
Abishek Purushothaman
 
Chapter23 friend-function-friend-class
Chapter23 friend-function-friend-classChapter23 friend-function-friend-class
Chapter23 friend-function-friend-classDeepak Singh
 
Framework Design Guidelines
Framework Design GuidelinesFramework Design Guidelines
Framework Design Guidelines
Mohamed Meligy
 
Unusual C# - OOP
Unusual C# - OOPUnusual C# - OOP
Unusual C# - OOP
Medhat Dawoud
 

What's hot (12)

C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
 
Java adapter
Java adapterJava adapter
Java adapter
 
Understanding Interfaces
Understanding InterfacesUnderstanding Interfaces
Understanding Interfaces
 
Friend function OOPC
Friend function OOPCFriend function OOPC
Friend function OOPC
 
code analysis for c++
code analysis for c++code analysis for c++
code analysis for c++
 
Java Interface
Java InterfaceJava Interface
Java Interface
 
Total oop in c# dot net
Total oop in c# dot netTotal oop in c# dot net
Total oop in c# dot net
 
Interfaces in java
Interfaces in javaInterfaces in java
Interfaces in java
 
Chapter23 friend-function-friend-class
Chapter23 friend-function-friend-classChapter23 friend-function-friend-class
Chapter23 friend-function-friend-class
 
Generics
GenericsGenerics
Generics
 
Framework Design Guidelines
Framework Design GuidelinesFramework Design Guidelines
Framework Design Guidelines
 
Unusual C# - OOP
Unusual C# - OOPUnusual C# - OOP
Unusual C# - OOP
 

Similar to Hiding the implementation in c++

Lecture 9
Lecture 9Lecture 9
Lecture 9
Mohammed Saleh
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
Ajay Chimmani
 
Introduction to object oriented programming concepts
Introduction to object oriented programming conceptsIntroduction to object oriented programming concepts
Introduction to object oriented programming concepts
Ganesh Karthik
 
C++ Notes
C++ NotesC++ Notes
CLASSES AND OBJECTS IN C++ +2 COMPUTER SCIENCE
CLASSES AND OBJECTS IN C++ +2 COMPUTER SCIENCECLASSES AND OBJECTS IN C++ +2 COMPUTER SCIENCE
CLASSES AND OBJECTS IN C++ +2 COMPUTER SCIENCE
Venugopalavarma Raja
 
OOPs & C++ UNIT 3
OOPs & C++ UNIT 3OOPs & C++ UNIT 3
OOPs & C++ UNIT 3
SURBHI SAROHA
 
11 Inheritance.ppt
11 Inheritance.ppt11 Inheritance.ppt
11 Inheritance.ppt
LadallaRajKumar
 
Access controlaspecifier and visibilty modes
Access controlaspecifier and visibilty modesAccess controlaspecifier and visibilty modes
Access controlaspecifier and visibilty modes
Vinay Kumar
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++
RAJ KUMAR
 
Object and class presentation
Object and class presentationObject and class presentation
Object and class presentation
nafisa rahman
 
C++ presentation
C++ presentationC++ presentation
C++ presentation
SudhanshuVijay3
 
Opps
OppsOpps
Friend function
Friend functionFriend function
Friend function
Heet Patel
 
Oop lec 4(oop design, style, characteristics)
Oop lec 4(oop design, style, characteristics)Oop lec 4(oop design, style, characteristics)
Oop lec 4(oop design, style, characteristics)Asfand Hassan
 
OOP Week 3 Lecture 2.pptx
OOP Week 3 Lecture 2.pptxOOP Week 3 Lecture 2.pptx
OOP Week 3 Lecture 2.pptx
whoiam36
 
Opp concept in c++
Opp concept in c++Opp concept in c++
Opp concept in c++
SadiqullahGhani1
 
chapter-7-classes-and-objects.pdf
chapter-7-classes-and-objects.pdfchapter-7-classes-and-objects.pdf
chapter-7-classes-and-objects.pdf
study material
 
C++ Object Oriented Programming
C++  Object Oriented ProgrammingC++  Object Oriented Programming
C++ Object Oriented Programming
Gamindu Udayanga
 

Similar to Hiding the implementation in c++ (20)

Lecture 9
Lecture 9Lecture 9
Lecture 9
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
 
Introduction to object oriented programming concepts
Introduction to object oriented programming conceptsIntroduction to object oriented programming concepts
Introduction to object oriented programming concepts
 
cse l 5.pptx
cse l 5.pptxcse l 5.pptx
cse l 5.pptx
 
C++ Notes
C++ NotesC++ Notes
C++ Notes
 
CLASSES AND OBJECTS IN C++ +2 COMPUTER SCIENCE
CLASSES AND OBJECTS IN C++ +2 COMPUTER SCIENCECLASSES AND OBJECTS IN C++ +2 COMPUTER SCIENCE
CLASSES AND OBJECTS IN C++ +2 COMPUTER SCIENCE
 
OOPs & C++ UNIT 3
OOPs & C++ UNIT 3OOPs & C++ UNIT 3
OOPs & C++ UNIT 3
 
11 Inheritance.ppt
11 Inheritance.ppt11 Inheritance.ppt
11 Inheritance.ppt
 
Access controlaspecifier and visibilty modes
Access controlaspecifier and visibilty modesAccess controlaspecifier and visibilty modes
Access controlaspecifier and visibilty modes
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++
 
Object and class presentation
Object and class presentationObject and class presentation
Object and class presentation
 
C++ presentation
C++ presentationC++ presentation
C++ presentation
 
DS Unit 6.ppt
DS Unit 6.pptDS Unit 6.ppt
DS Unit 6.ppt
 
Opps
OppsOpps
Opps
 
Friend function
Friend functionFriend function
Friend function
 
Oop lec 4(oop design, style, characteristics)
Oop lec 4(oop design, style, characteristics)Oop lec 4(oop design, style, characteristics)
Oop lec 4(oop design, style, characteristics)
 
OOP Week 3 Lecture 2.pptx
OOP Week 3 Lecture 2.pptxOOP Week 3 Lecture 2.pptx
OOP Week 3 Lecture 2.pptx
 
Opp concept in c++
Opp concept in c++Opp concept in c++
Opp concept in c++
 
chapter-7-classes-and-objects.pdf
chapter-7-classes-and-objects.pdfchapter-7-classes-and-objects.pdf
chapter-7-classes-and-objects.pdf
 
C++ Object Oriented Programming
C++  Object Oriented ProgrammingC++  Object Oriented Programming
C++ Object Oriented Programming
 

Hiding the implementation in c++

  • 1. Hiding the implementation Because I don't want you to know how I do it Daniel Rodríguez    (Twitter: @sethillgard)
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.