SlideShare a Scribd company logo
1 of 20
Information Hiding
Group Members
• Sameen
• Nazia
By Information Hiding we mean “Showing only
those details to the outside world which
are necessary for the outside world and hiding
all other details from the outside world.”
Real Life Examples of Information Hiding
• Sameen’s name and her personal information is
stored in her brain you can’t access this information
directly. For getting this information we need to ask
Sameen about it and it will be up to Sameen how
much details he would like to share with you.
• We have multimedia in our class, we saw the
working of multimedia that we use it to share our
ideas and teachers use it to deliver their lectures.
But we do not know about its internal functions.
• A phone SIM card may store several phone numbers
but we can’t read the numbers directly from the
SIM card rather phone-set reads this information for
us and if the owner of this phone has not allowed
others to see the numbers saved in this phone we
will not be able to see those phone numbers using
phone.
Advantages of Information Hiding
• There are two major advantages of information hiding
which are as follows:
 It simplifies our Object Oriented Model:
As we saw that our OO model had objects and their
interactions hiding details so it makes it easier to
understand our OO model.
 It is a barrier against change propagation:
As implementation of functions is limited to our class
and we have given name of functions to user with
description of parameters so if we change
implementation of function it doesn’t affect the OO
model.
Information hiding using Encapsulation and
Abstraction
•Encapsulation
•Abstraction
Encapsulation
• Encapsulation means “we have enclosed all the
characteristics of an object in the object itself”.
• Encapsulation is a mechanism of bundling the data,
and the functions that use them.
• Both the information structure and implementation
details of its operations are hidden from the outer
world.
Examples of encapsulation:
• Ali stores his personal information and knows how
to translate it to the desired language.
• We don’t know
– How the data is stored
– How Ali translates this information
• We know the name of Ali and knows he can walk
and eat but we do not knows his personal
information.
• A Phone stores phone numbers in digital format and
knows how it works, we do not know internally
about phone.
• We don’t know
– How the data is stored.
– How it is converted to human-readable
characters.
Internal view External view
Advantages of Encapsulation
• Simplicity and clarity
• Low complexity
• Better understanding
Abstraction
• Real life objects have a lot of attributes and many
kind of behaviors but most of the time we are
interested in only that part of the objects that is
related to the problem we are currently going to
solve.
• We also say that “Capture only those details about
an object that are relevant to current perspective”
Example of Abstraction
• If our data required organisms, mammals, humans
then we have
• If our data required organisms, mammals,
dangerous mammals then we have
• A cat can be viewed with different perspectives
Abstraction – Advantages
• It helps us understanding and solving a problem
using object oriented approach as it hides extra
irrelevant details of objects.
• Focusing on single perspective of an object provides
us freedom to change implementation for other
aspects of for an object later.

More Related Content

Viewers also liked

Abstraction in java
Abstraction in javaAbstraction in java
Abstraction in java
sawarkar17
 
Seminar on polymorphism
Seminar on polymorphismSeminar on polymorphism
Seminar on polymorphism
023henil
 
8 abstract classes and interfaces
8   abstract classes and interfaces 8   abstract classes and interfaces
8 abstract classes and interfaces
Tuan Ngo
 

Viewers also liked (16)

Abstraction in java
Abstraction in javaAbstraction in java
Abstraction in java
 
Abstract class and Interface
Abstract class and InterfaceAbstract class and Interface
Abstract class and Interface
 
Chapter2 Encapsulation (Java)
Chapter2 Encapsulation (Java)Chapter2 Encapsulation (Java)
Chapter2 Encapsulation (Java)
 
Inheritance and Polymorphism
Inheritance and PolymorphismInheritance and Polymorphism
Inheritance and Polymorphism
 
Java Programming - Abstract Class and Interface
Java Programming - Abstract Class and InterfaceJava Programming - Abstract Class and Interface
Java Programming - Abstract Class and Interface
 
Java OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & InterfaceJava OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & Interface
 
Inheritance
InheritanceInheritance
Inheritance
 
polymorphism
polymorphism polymorphism
polymorphism
 
Inheritance
InheritanceInheritance
Inheritance
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
JAVA Polymorphism
JAVA PolymorphismJAVA Polymorphism
JAVA Polymorphism
 
Seminar on polymorphism
Seminar on polymorphismSeminar on polymorphism
Seminar on polymorphism
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
8 abstract classes and interfaces
8   abstract classes and interfaces 8   abstract classes and interfaces
8 abstract classes and interfaces
 
Chapter 9 Abstract Class
Chapter 9 Abstract ClassChapter 9 Abstract Class
Chapter 9 Abstract Class
 

Similar to Oop

NLP (4) for class 9 (1).pptx nnnnnnnnnnnnnnnnnnnnnnnnnnnnn
NLP (4) for class 9 (1).pptx nnnnnnnnnnnnnnnnnnnnnnnnnnnnnNLP (4) for class 9 (1).pptx nnnnnnnnnnnnnnnnnnnnnnnnnnnnn
NLP (4) for class 9 (1).pptx nnnnnnnnnnnnnnnnnnnnnnnnnnnnn
shradhasharma2101
 
1RSCH 300 Introduction to Business ResearchWeek 5Dr..docx
1RSCH 300 Introduction to Business ResearchWeek 5Dr..docx1RSCH 300 Introduction to Business ResearchWeek 5Dr..docx
1RSCH 300 Introduction to Business ResearchWeek 5Dr..docx
felicidaddinwoodie
 
BSides Rhode Island 2013 - Bite the Wax Tadpole (with Katrina Rodzon)
BSides Rhode Island 2013 - Bite the Wax Tadpole (with Katrina Rodzon)BSides Rhode Island 2013 - Bite the Wax Tadpole (with Katrina Rodzon)
BSides Rhode Island 2013 - Bite the Wax Tadpole (with Katrina Rodzon)
Mike Murray
 
UNIT 1 IX (1) (2) (1).pptx
UNIT 1 IX (1) (2) (1).pptxUNIT 1 IX (1) (2) (1).pptx
UNIT 1 IX (1) (2) (1).pptx
siddhichaddha2
 
UNIT 1 IX (1) (2) (3).pptx
UNIT 1 IX (1) (2) (3).pptxUNIT 1 IX (1) (2) (3).pptx
UNIT 1 IX (1) (2) (3).pptx
siddhichaddha2
 
UNIT 1 IX (1) (2) (2).pptx
UNIT 1 IX (1) (2) (2).pptxUNIT 1 IX (1) (2) (2).pptx
UNIT 1 IX (1) (2) (2).pptx
siddhichaddha2
 

Similar to Oop (20)

Object oriented progrmming
Object oriented progrmmingObject oriented progrmming
Object oriented progrmming
 
Designing agents as if people mattered
Designing agents as if people matteredDesigning agents as if people mattered
Designing agents as if people mattered
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Smartphone security and privacy: you're doing it wrong
Smartphone security and privacy: you're doing it wrongSmartphone security and privacy: you're doing it wrong
Smartphone security and privacy: you're doing it wrong
 
WEEK-3-4-Access-to-Business-tools-and-tech-PART-2.pdf
WEEK-3-4-Access-to-Business-tools-and-tech-PART-2.pdfWEEK-3-4-Access-to-Business-tools-and-tech-PART-2.pdf
WEEK-3-4-Access-to-Business-tools-and-tech-PART-2.pdf
 
NLP (4) for class 9 (1).pptx nnnnnnnnnnnnnnnnnnnnnnnnnnnnn
NLP (4) for class 9 (1).pptx nnnnnnnnnnnnnnnnnnnnnnnnnnnnnNLP (4) for class 9 (1).pptx nnnnnnnnnnnnnnnnnnnnnnnnnnnnn
NLP (4) for class 9 (1).pptx nnnnnnnnnnnnnnnnnnnnnnnnnnnnn
 
Data Protection – How Not to Panic and Make it a Positive
Data Protection – How Not to Panic and Make it a PositiveData Protection – How Not to Panic and Make it a Positive
Data Protection – How Not to Panic and Make it a Positive
 
1RSCH 300 Introduction to Business ResearchWeek 5Dr..docx
1RSCH 300 Introduction to Business ResearchWeek 5Dr..docx1RSCH 300 Introduction to Business ResearchWeek 5Dr..docx
1RSCH 300 Introduction to Business ResearchWeek 5Dr..docx
 
Lec07 data hiding and encapsulation
Lec07   data hiding and encapsulationLec07   data hiding and encapsulation
Lec07 data hiding and encapsulation
 
5.-Knowledge-Representation-in-AI_010824.pdf
5.-Knowledge-Representation-in-AI_010824.pdf5.-Knowledge-Representation-in-AI_010824.pdf
5.-Knowledge-Representation-in-AI_010824.pdf
 
BSides Rhode Island 2013 - Bite the Wax Tadpole (with Katrina Rodzon)
BSides Rhode Island 2013 - Bite the Wax Tadpole (with Katrina Rodzon)BSides Rhode Island 2013 - Bite the Wax Tadpole (with Katrina Rodzon)
BSides Rhode Island 2013 - Bite the Wax Tadpole (with Katrina Rodzon)
 
Creating a digital toolkit for users: How to teach our users how to limit the...
Creating a digital toolkit for users: How to teach our users how to limit the...Creating a digital toolkit for users: How to teach our users how to limit the...
Creating a digital toolkit for users: How to teach our users how to limit the...
 
Generative Analysis Overview
Generative Analysis OverviewGenerative Analysis Overview
Generative Analysis Overview
 
UNIT 1 IX (1) (1).pptx
UNIT 1 IX (1) (1).pptxUNIT 1 IX (1) (1).pptx
UNIT 1 IX (1) (1).pptx
 
UNIT 1 IX (1) (2) (1).pptx
UNIT 1 IX (1) (2) (1).pptxUNIT 1 IX (1) (2) (1).pptx
UNIT 1 IX (1) (2) (1).pptx
 
UNIT 1 IX (1) (2) (3).pptx
UNIT 1 IX (1) (2) (3).pptxUNIT 1 IX (1) (2) (3).pptx
UNIT 1 IX (1) (2) (3).pptx
 
UNIT 1 IX (1) (2) (2).pptx
UNIT 1 IX (1) (2) (2).pptxUNIT 1 IX (1) (2) (2).pptx
UNIT 1 IX (1) (2) (2).pptx
 
Oo concepts and class modeling
Oo concepts and class modelingOo concepts and class modeling
Oo concepts and class modeling
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
AI Project Cycle Case study 1.pptx
AI Project Cycle Case study 1.pptxAI Project Cycle Case study 1.pptx
AI Project Cycle Case study 1.pptx
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

Oop

  • 3. By Information Hiding we mean “Showing only those details to the outside world which are necessary for the outside world and hiding all other details from the outside world.”
  • 4. Real Life Examples of Information Hiding • Sameen’s name and her personal information is stored in her brain you can’t access this information directly. For getting this information we need to ask Sameen about it and it will be up to Sameen how much details he would like to share with you. • We have multimedia in our class, we saw the working of multimedia that we use it to share our ideas and teachers use it to deliver their lectures. But we do not know about its internal functions.
  • 5. • A phone SIM card may store several phone numbers but we can’t read the numbers directly from the SIM card rather phone-set reads this information for us and if the owner of this phone has not allowed others to see the numbers saved in this phone we will not be able to see those phone numbers using phone.
  • 6.
  • 7. Advantages of Information Hiding • There are two major advantages of information hiding which are as follows:  It simplifies our Object Oriented Model: As we saw that our OO model had objects and their interactions hiding details so it makes it easier to understand our OO model.  It is a barrier against change propagation: As implementation of functions is limited to our class and we have given name of functions to user with description of parameters so if we change implementation of function it doesn’t affect the OO model.
  • 8. Information hiding using Encapsulation and Abstraction •Encapsulation •Abstraction
  • 9. Encapsulation • Encapsulation means “we have enclosed all the characteristics of an object in the object itself”. • Encapsulation is a mechanism of bundling the data, and the functions that use them. • Both the information structure and implementation details of its operations are hidden from the outer world.
  • 11. • Ali stores his personal information and knows how to translate it to the desired language. • We don’t know – How the data is stored – How Ali translates this information
  • 12. • We know the name of Ali and knows he can walk and eat but we do not knows his personal information.
  • 13. • A Phone stores phone numbers in digital format and knows how it works, we do not know internally about phone. • We don’t know – How the data is stored. – How it is converted to human-readable characters.
  • 15. Advantages of Encapsulation • Simplicity and clarity • Low complexity • Better understanding
  • 16. Abstraction • Real life objects have a lot of attributes and many kind of behaviors but most of the time we are interested in only that part of the objects that is related to the problem we are currently going to solve. • We also say that “Capture only those details about an object that are relevant to current perspective”
  • 17. Example of Abstraction • If our data required organisms, mammals, humans then we have
  • 18. • If our data required organisms, mammals, dangerous mammals then we have
  • 19. • A cat can be viewed with different perspectives
  • 20. Abstraction – Advantages • It helps us understanding and solving a problem using object oriented approach as it hides extra irrelevant details of objects. • Focusing on single perspective of an object provides us freedom to change implementation for other aspects of for an object later.