SlideShare a Scribd company logo
1 of 11
The Story of Object-Oriented Programming
• In object-oriented programming, your program will be split into
several small, manageable, reusable programs. Each small program
has it’s own identity, data, logic which communicates with the rest of
the other small programs.
• Objects
When you think about Objects, you should think about the real world
situations. Object-Orientation was intended to be closer to the real world,
hence, make it easier and more realistic.
The Story of Object-Oriented Programming
• What are the Objects?
Something visible for you, like the car, phone, apple, duck, lamp.
Something that you can’t touch, like the Time, Event, Account.
The Story of Object-Oriented Programming
• Each Objects has it’s own attributes, and behavior. Objects are
separate from one another. They have their own existence, their own
identity that is independent of other objects.
• Attributes
Attributes are the characteristics or the properties of the Object, like for
example, in case of a duck, it’s weight & color.
• Behavior
Behavior is things that the Object can do, in case of duck, It can fly.
• Another example, in case of Account, Account name, Account number
and balance are its properties and deposit and withdraw are
behaviors.
The Story of Object-Oriented Programming
• Now, the questions is, How do we construct these objects in our
program?
Well, They don’t magically appear in our program, and to do that, there is
another word we must explore that goes hand in hand with object, and that
word is Class. When you start talking about Objects, you have to mention
Classes.
• Class
A class is the place where you can identify the behaviors and properties of an
Object. So, the properties and behavior of an Object, will be defined inside a
class.
The Story of Object-Oriented Programming
• A class is a blueprint which provides the definition for an Object, the
definition says what are the properties and the behaviors of the
Object.
• Let’s take an example, When you build a house, you start making
the blueprint, in other words you start defining it’s properties and
behaviors, and then, you use this blueprint to build different houses,
or more formally, different objects from the same blueprint.
• So, Objects from the same blueprint, or more formally the same class,
share the same properties and behaviors. However, even they share
the same Class, each Object instantiated from this Class is
independent on the other.
The Story of Object-Oriented Programming
• Abstraction
Abstraction means you start focusing on the common properties and behaviors of
some Objects, and we automatically will discard what’s unimportant or irrelevant.
What came into your mind when I say “Car”?
If we say Car, we didn’t explicitly say if the car is
BMW or Audi, if it’s red or black, if it’s small or
large. Your mental model of a car might have a
color and size, but, it’s unlikely to have a smell or
a flavor because those things are irrelevant to
the idea of a car.
In case of Cars, maybe you will have different
brands like, BMW, Audi, Bugatti, Chevrolet,
Citroen and so on. But, we don’t create a class
for each brand, instead, we will abstract; focus
on the common essential qualities of the idea,
and we will write one class called Car.
The Story of Object-Oriented Programming
• Encapsulation
Encapsulation is the process of compartmentalizing the elements of an
abstraction that constitutes its structure and behavior. Encapsulation serves to
separate the contractual interface of an abstraction and its implementation.
Abstraction and encapsulations are complimentary concepts.
Encapsulation is the process of binding both attributes and methods together
within a class. Through encapsulation, the internal details of a class can be
hidden from outside.
What is inside the
car is hidden
The Story of Object-Oriented Programming
• Inheritance
Abstraction is, instead of creating different classes, we can instead create one
generic class that has the common, and essential properties and behavior of
those classes, while Inheritance is inheriting these common properties and
behaviors, so that we can create a new class, but instead of writing it from
scratch, we can base it on an existing class.
The Story of Object-Oriented Programming
• A Person class with a attributes; name and address and phone
number. Now, you need to create another one called Customer. It has
the same attributes as Person, but it also has additional attributes
and methods.
• So, we are going to inherit from the Person class. And the Customer
class will automatically has everything that the Person class has, all its
attributes, all its behaviors, without us having to write any code. In
addition, If we make a change in the Person class, it will automatically
cascade down and affect the inheriting classes.
The Story of Object-Oriented Programming
• Polymorphism
Polymorphism is the state where an object can take the shape of many different
forms.
• If you have Animal class, and inheriting classes; Dog, Cat, & Duck. Each of the
inheriting classes override the speak method (as each animal has a different
voice).
• Now, we can call the speak method on any animal object, without knowing
exactly what class the animal object was instantiated from, and it will do the
correct behavior.

More Related Content

Similar to OOPS story.pptx

M01 Oo Intro
M01 Oo IntroM01 Oo Intro
M01 Oo Intro
Dang Tuan
 
Object And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) LanguagesObject And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) Languages
Jessica Deakin
 

Similar to OOPS story.pptx (20)

SAD02 - Object Orientation
SAD02 - Object OrientationSAD02 - Object Orientation
SAD02 - Object Orientation
 
Object oriented programming concept- Saurabh Upadhyay
Object oriented programming concept- Saurabh UpadhyayObject oriented programming concept- Saurabh Upadhyay
Object oriented programming concept- Saurabh Upadhyay
 
CPP-Unit 1.pptx
CPP-Unit 1.pptxCPP-Unit 1.pptx
CPP-Unit 1.pptx
 
Abstraction and Encapsulation
Abstraction and EncapsulationAbstraction and Encapsulation
Abstraction and Encapsulation
 
Objects and Classes.pptx
Objects and Classes.pptxObjects and Classes.pptx
Objects and Classes.pptx
 
Objects and Classes.pptx
Objects and Classes.pptxObjects and Classes.pptx
Objects and Classes.pptx
 
Objects and Classes BRIEF.pptx
Objects and Classes BRIEF.pptxObjects and Classes BRIEF.pptx
Objects and Classes BRIEF.pptx
 
Storytime with Jason (embedded notes)
Storytime with Jason (embedded notes)Storytime with Jason (embedded notes)
Storytime with Jason (embedded notes)
 
M01 Oo Intro
M01 Oo IntroM01 Oo Intro
M01 Oo Intro
 
Introduction
IntroductionIntroduction
Introduction
 
Object-Oriented concepts.pptx
Object-Oriented concepts.pptxObject-Oriented concepts.pptx
Object-Oriented concepts.pptx
 
Object And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) LanguagesObject And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) Languages
 
O6u CS-315A OOP Lecture (1).pdf
O6u CS-315A OOP Lecture (1).pdfO6u CS-315A OOP Lecture (1).pdf
O6u CS-315A OOP Lecture (1).pdf
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
ITFT - Oops
ITFT - OopsITFT - Oops
ITFT - Oops
 
COMP111-Week-1_138439.pptx
COMP111-Week-1_138439.pptxCOMP111-Week-1_138439.pptx
COMP111-Week-1_138439.pptx
 
Introduction To Design Patterns Class 4 Composition vs Inheritance
 Introduction To Design Patterns Class 4 Composition vs Inheritance Introduction To Design Patterns Class 4 Composition vs Inheritance
Introduction To Design Patterns Class 4 Composition vs Inheritance
 
1-oop java-object
1-oop java-object1-oop java-object
1-oop java-object
 
introduction of Object oriented programming
introduction of Object oriented programmingintroduction of Object oriented programming
introduction of Object oriented programming
 
object oriented programming(syed munib ali 11b-023-bs)
object oriented programming(syed munib ali 11b-023-bs)object oriented programming(syed munib ali 11b-023-bs)
object oriented programming(syed munib ali 11b-023-bs)
 

Recently uploaded

一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理
cyebo
 
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
JIT KUMAR GUPTA
 
Heuristic Evaluation of System & Application
Heuristic Evaluation of System & ApplicationHeuristic Evaluation of System & Application
Heuristic Evaluation of System & Application
Jaime Brown
 
Presentation on 3D Printing.pptx presentation
Presentation on 3D Printing.pptx presentationPresentation on 3D Printing.pptx presentation
Presentation on 3D Printing.pptx presentation
ajroy0196
 

Recently uploaded (20)

And that's about to change! (Service Design Drinks Berlin May 2024)
And that's about to change! (Service Design Drinks Berlin May 2024)And that's about to change! (Service Design Drinks Berlin May 2024)
And that's about to change! (Service Design Drinks Berlin May 2024)
 
Bit Dhrumi shah Graphic Designer portfolio
Bit Dhrumi shah Graphic Designer portfolioBit Dhrumi shah Graphic Designer portfolio
Bit Dhrumi shah Graphic Designer portfolio
 
Design lessons from Singapore | Volume 3
Design lessons from Singapore | Volume 3Design lessons from Singapore | Volume 3
Design lessons from Singapore | Volume 3
 
一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理
 
BIT Khushi gandhi project.pdf graphic design
BIT Khushi gandhi project.pdf graphic designBIT Khushi gandhi project.pdf graphic design
BIT Khushi gandhi project.pdf graphic design
 
Naer VR: Advanced Research and Usability Testing Project
Naer VR: Advanced Research and Usability Testing ProjectNaer VR: Advanced Research and Usability Testing Project
Naer VR: Advanced Research and Usability Testing Project
 
NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...
NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...
NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...
 
CADD 141 - Puzzle Cube Project - Product Photos
CADD 141 - Puzzle Cube Project - Product PhotosCADD 141 - Puzzle Cube Project - Product Photos
CADD 141 - Puzzle Cube Project - Product Photos
 
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
 
Abdulaziz Tariq Abdulaziz Mustafa CV 2024
Abdulaziz Tariq Abdulaziz Mustafa CV 2024Abdulaziz Tariq Abdulaziz Mustafa CV 2024
Abdulaziz Tariq Abdulaziz Mustafa CV 2024
 
Heuristic Evaluation of System & Application
Heuristic Evaluation of System & ApplicationHeuristic Evaluation of System & Application
Heuristic Evaluation of System & Application
 
CADD 141 - BIRD Scooter - Cup Holder Photos.pdf
CADD 141 - BIRD Scooter - Cup Holder Photos.pdfCADD 141 - BIRD Scooter - Cup Holder Photos.pdf
CADD 141 - BIRD Scooter - Cup Holder Photos.pdf
 
Design Portofolios - Licensed Architect / BIM Specialist
Design Portofolios - Licensed Architect / BIM SpecialistDesign Portofolios - Licensed Architect / BIM Specialist
Design Portofolios - Licensed Architect / BIM Specialist
 
The Journey of Fashion Designer Sketches - From Concept to Catwalk
The Journey of Fashion Designer Sketches - From Concept to CatwalkThe Journey of Fashion Designer Sketches - From Concept to Catwalk
The Journey of Fashion Designer Sketches - From Concept to Catwalk
 
Claire's designing portfolio presentation
Claire's designing portfolio presentationClaire's designing portfolio presentation
Claire's designing portfolio presentation
 
Webhost NVME Cloud VPS Hosting1234455678
Webhost NVME Cloud VPS Hosting1234455678Webhost NVME Cloud VPS Hosting1234455678
Webhost NVME Cloud VPS Hosting1234455678
 
Heidi Livengood's Professional CADD Portfolio
Heidi Livengood's Professional CADD PortfolioHeidi Livengood's Professional CADD Portfolio
Heidi Livengood's Professional CADD Portfolio
 
Presentation on 3D Printing.pptx presentation
Presentation on 3D Printing.pptx presentationPresentation on 3D Printing.pptx presentation
Presentation on 3D Printing.pptx presentation
 
Recycled Modular Low Cost Construction .pdf
Recycled Modular Low Cost Construction .pdfRecycled Modular Low Cost Construction .pdf
Recycled Modular Low Cost Construction .pdf
 
Latest Trends in Home and Building Design
Latest Trends in Home and Building DesignLatest Trends in Home and Building Design
Latest Trends in Home and Building Design
 

OOPS story.pptx

  • 1.
  • 2. The Story of Object-Oriented Programming • In object-oriented programming, your program will be split into several small, manageable, reusable programs. Each small program has it’s own identity, data, logic which communicates with the rest of the other small programs. • Objects When you think about Objects, you should think about the real world situations. Object-Orientation was intended to be closer to the real world, hence, make it easier and more realistic.
  • 3. The Story of Object-Oriented Programming • What are the Objects? Something visible for you, like the car, phone, apple, duck, lamp. Something that you can’t touch, like the Time, Event, Account.
  • 4. The Story of Object-Oriented Programming • Each Objects has it’s own attributes, and behavior. Objects are separate from one another. They have their own existence, their own identity that is independent of other objects. • Attributes Attributes are the characteristics or the properties of the Object, like for example, in case of a duck, it’s weight & color. • Behavior Behavior is things that the Object can do, in case of duck, It can fly. • Another example, in case of Account, Account name, Account number and balance are its properties and deposit and withdraw are behaviors.
  • 5. The Story of Object-Oriented Programming • Now, the questions is, How do we construct these objects in our program? Well, They don’t magically appear in our program, and to do that, there is another word we must explore that goes hand in hand with object, and that word is Class. When you start talking about Objects, you have to mention Classes. • Class A class is the place where you can identify the behaviors and properties of an Object. So, the properties and behavior of an Object, will be defined inside a class.
  • 6. The Story of Object-Oriented Programming • A class is a blueprint which provides the definition for an Object, the definition says what are the properties and the behaviors of the Object. • Let’s take an example, When you build a house, you start making the blueprint, in other words you start defining it’s properties and behaviors, and then, you use this blueprint to build different houses, or more formally, different objects from the same blueprint. • So, Objects from the same blueprint, or more formally the same class, share the same properties and behaviors. However, even they share the same Class, each Object instantiated from this Class is independent on the other.
  • 7. The Story of Object-Oriented Programming • Abstraction Abstraction means you start focusing on the common properties and behaviors of some Objects, and we automatically will discard what’s unimportant or irrelevant. What came into your mind when I say “Car”? If we say Car, we didn’t explicitly say if the car is BMW or Audi, if it’s red or black, if it’s small or large. Your mental model of a car might have a color and size, but, it’s unlikely to have a smell or a flavor because those things are irrelevant to the idea of a car. In case of Cars, maybe you will have different brands like, BMW, Audi, Bugatti, Chevrolet, Citroen and so on. But, we don’t create a class for each brand, instead, we will abstract; focus on the common essential qualities of the idea, and we will write one class called Car.
  • 8. The Story of Object-Oriented Programming • Encapsulation Encapsulation is the process of compartmentalizing the elements of an abstraction that constitutes its structure and behavior. Encapsulation serves to separate the contractual interface of an abstraction and its implementation. Abstraction and encapsulations are complimentary concepts. Encapsulation is the process of binding both attributes and methods together within a class. Through encapsulation, the internal details of a class can be hidden from outside. What is inside the car is hidden
  • 9. The Story of Object-Oriented Programming • Inheritance Abstraction is, instead of creating different classes, we can instead create one generic class that has the common, and essential properties and behavior of those classes, while Inheritance is inheriting these common properties and behaviors, so that we can create a new class, but instead of writing it from scratch, we can base it on an existing class.
  • 10. The Story of Object-Oriented Programming • A Person class with a attributes; name and address and phone number. Now, you need to create another one called Customer. It has the same attributes as Person, but it also has additional attributes and methods. • So, we are going to inherit from the Person class. And the Customer class will automatically has everything that the Person class has, all its attributes, all its behaviors, without us having to write any code. In addition, If we make a change in the Person class, it will automatically cascade down and affect the inheriting classes.
  • 11. The Story of Object-Oriented Programming • Polymorphism Polymorphism is the state where an object can take the shape of many different forms. • If you have Animal class, and inheriting classes; Dog, Cat, & Duck. Each of the inheriting classes override the speak method (as each animal has a different voice). • Now, we can call the speak method on any animal object, without knowing exactly what class the animal object was instantiated from, and it will do the correct behavior.