SlideShare a Scribd company logo
OOP History and Core
Concepts
Nghia Bui
katatunix@gmail.com
Nov 2017
2
What’s wrong with
OOP?
3
4
5
6
8
9
‱ So a lot of people are complaining about OOP
‱ And we are still sitting here to talk about
it???
9
Read more at:
http://www.yegor256.com/2016/08/15/what-
is-wrong-object-oriented-programming.html
The fact is that

‱ Asking 10 people about what is OOP, received 11
answers, e.g.:
– “OOP is bundling data and functions together”
– “OOP is programming with classes and inheritance”
– “OOP is all about behavior”
– “OOP is all about message passing”
– “OOP is programming with abstraction, encapsulation,
polymorphism, and inheritance”
– 

10
The misuse of OOP
‱ OOP is just a tool in your programming toolbox
‱ Just like any tool, it can be misused
‱ OOP has been misused, both in academy and
industry:
– Focus too much on class inheritance: the strongest
relationship which encourages tight-coupling
– Abuse of mutable state: object state can change over
time (with, e.g., setter methods) unnecessarily
– Use god objects which defeat the purpose of objects:
breaking-down program into small and manageable
pieces called objects
11
OOP is actually a good tool
‱ Every tool is good if you know what it is!
‱ That’s why we – as software developers – still
need to learn OOP, but in a correct way!
12
OOP History
[1960s] Simula: the first OO lang
‱ Two Norwegians – Kristen
Nygaard and Ole-Johan Dahl –
working for the Norwegian
Defense research
‱ In 1960s they created Simula to
solve modeling problems:
– “They were working on simulations
that deal with exploding ships, and
realized they could group the ships
into different categories. Each ship
type would have its own class, and
the class would generate its unique
behavior and data. Simula was not
only responsible for introducing the
concept of a class, but it also
introduced the instance of a class.”
‱ Dahl–Nygaard Prize
14
Story: http://www.exforsys.com/tutorials/oops-concepts/the-history-of-object-oriented-programming.html
Image: http://web.cecs.pdx.edu/~black/publications/O-JDahl.pdf
[1970s] Smalltalk: the purist OO lang
‱ The term OOP was first used by
Alan Kay at Xerox PARC in their
Smalltalk language
‱ The term was used to refer to
the process of using objects as
the foundation for computation
‱ The Smalltalk team was
inspired by the Simula project,
but they designed Smalltalk so
that it would be dynamic
‱ Purist:
– Everything is an object
– No primitive types (int, float
)
– Message-passing style, not
method-invocation style
15
Since then

1983: Bjarne
Stroustrup
ported the ideas
of Simula to C
to support
simulation
programming 
“C with classes”
 C++
1984: Brad Cox
added
Smalltalk-style
message-
passing syntax
to C and called
it “Objective-C”
1995: Java –
created by
James Gosling –
integrated
implementation
technology from
Smalltalk and
syntax from C++
2000: C# is the
main language
of the .NET
platform from
Microsoft, it
was created by
Anders
Hejlsberg, the
most recent
version is C# 7.1
16
Not to mention JavaScript, Ruby, Python

OOP Motivation and
Core Concepts
In this section, only the core, essential, and general concepts
of OOP are discussed, language concepts are ignored
Behaviors and Data
‱ All software are about behaviors (*) operating on data,
regardless the paradigm (Procedural/OO/Functional)
‱ Data has concepts of:
– “type” (or “structure”)
– “value” (or “state”)
‱ To operate on data, a behavior must:
– understand the structure of the data
– have ability of accessing/modifying/creating/deleting the
state of the data
‱ Behavior A can make use of (interact with) behavior B
18
(*) you can think behaviors as functions/procedures, here I want to avoid
using such language-specific terms, the term “behaviors” is more general
Procedural programming (PP):
data and behaviors are separated
19
‱ The Person struct is
likely to be used in
many places
‱ Those places may
accidentally change
the state of the
person data
‱ When the structure
of Person changes, all
of those places are
affected
 PROBLEM: data are
used in large scopes
 But it’s not the fault
of PP, it’s a matter of
discipline
The solution/discipline of OOP
‱ Data must be used in a small scope called object
‱ Only the object has the direct access to its
(internal) data
‱ The outside interacts with the object A by using
the behavior exposed/provided by A
‱ Objects know about each other through
behaviors, and make use of those behaviors by
interacting/communicating
‱ When decomposing program into objects, only
behaviors matter, data don’t
20
OOP is all about behaviors!
‱ Each object has one behavior
‱ A behavior = a set of parameterized
operations
‱ An object is recognized by its behavior, not its
data
21
The 4 characteristics of behaviors
‱ the behavior of an object is its abstraction
Abstraction
‱ the behavior of an object encapsulates (hides) its (internal) details
Encapsulation
‱ behaviors are polymorphic
Polymorphism
‱ behaviors are inheritable
Inheritance
22
Abstraction
‱ The behavior of an object is its abstraction
‱ The abstraction of an object is:
– the most essential thing of that object
– the most impressive thing of that object
– stable / unlikely to change
‱ Finding the right abstractions (i.e., correct
behaviors) of objects is the key to programming
with OO:
– The right abs depends on the domain/app
– What if we find the wrong abs?
‱ Wrong abs are likely to change
23
Encapsulation
‱ The behavior of an object encapsulates (hides)
its (internal) details
‱ Those details contain not only data but also
everything that needs to be hidden
‱ Abstraction and encapsulation are very closed:
– To achieve abstraction, we need encapsulation
– When we do encapsulation, we have abstraction
‱ Anyway, both of them are the heart of OOP
‱ They are really good for managing the complicity
of software
24
Polymorphism
‱ Behaviors are polymorphic
‱ If an object a works with object b:
– class A {void test(b){/*work with b*/}}
– class A {
private b;
A(b) { this.b = b; }
void test() {/*work with this.b*/}
}
‱ Then we can pass any object c behaving like b to
a and a still works well
‱ Benefit: Flexibility  Reusability
25
This technique is called
“dependency injection”
Inheritance
‱ Behaviors are inheritable
‱ If we have an object a has a behavior with 2
operations x() and y()
‱ Then there is a way to create an object b having
those 2 operations, and optionally with extra
customizations e.g.:
– adding operation z()
– removing operation x()
– overriding operation y()
‱ Benefit: Reusability
26
Not all languages
support this
Inheritance controversy
‱ In its essence, there is nothing wrong about
inheritance:
– It is a way to create objects having the same
behaviors to existing objects with optional
customizations
‱ So where does the controversy come from?
– Different languages have different ways to implement
object creation
– Thus, inheritance is implemented in very different
ways, some ways are even different from the essence
– Class inheritance in class-based & statically-typed
languages is the problematic one; sadly, these
languages are the most popular OOP languages
27
OOP key notes
‱ Using behaviors as the basis of abstraction is the
key of OOP.
‱ When a concept is abstracted and encapsulated
by a polymorphic behavior, we call it an object.
‱ When we program / design by defining objects,
creating objects and letting them interact in
order to achieve dedicated tasks, we call it
object-oriented programming / design.
28
Core concept vs. language concepts
Core
‱ Object, Behavior, Operation, Parameterized Operation,
Interaction, Communication, Abstraction, Encapsulation,
Polymorphism, Inheritance
Lang
‱ Type, Class, Struct, Method, Property, Interface, Abstract Class,
Public, Private, Protected, Method Overriding/Overloading,
Virtual Method, Class Inheritance, Exception, Static
Method/Property, Generic Type

‱ Class-based Style, Prototype-based Style
‱ Static Typing, Dynamic Typing
29

More Related Content

PPTX
Spring & hibernate
PPT
Ab initio training Ab-initio Architecture
PPTX
Solid principles
PPTX
Nodejs Session01
PDF
Collections In Java
PDF
Gentle Introduction to Scala
PPTX
Clean code: SOLID
Spring & hibernate
Ab initio training Ab-initio Architecture
Solid principles
Nodejs Session01
Collections In Java
Gentle Introduction to Scala
Clean code: SOLID

What's hot (20)

PDF
Monad Laws Must be Checked
PPTX
Life Cycle hooks in VueJs
PPTX
Basics of Object Oriented Programming
PDF
Java 8 Lambda Expressions
PDF
Reactive Card Magic: Understanding Spring WebFlux and Project Reactor
PPTX
Introduction to Object Oriented Programming
PDF
Liscov substitution principle
PDF
Contravariant functors in scala
PDF
Refactoring Functional Type Classes
PDF
Sagas Middleware Architecture
PDF
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
PDF
Les nouveautés de Java 19, 20 et 21 - RivieraDev 2023
PDF
recursion2
PDF
A Prelude of Purity: Scaling Back ZIO
PPTX
ASP.NET Web API
PDF
Clean architecture
PPTX
Next.js - ReactPlayIO.pptx
PPTX
Ajax and Jquery
PPTX
Exception Handling in C++
PPTX
java 8 new features
Monad Laws Must be Checked
Life Cycle hooks in VueJs
Basics of Object Oriented Programming
Java 8 Lambda Expressions
Reactive Card Magic: Understanding Spring WebFlux and Project Reactor
Introduction to Object Oriented Programming
Liscov substitution principle
Contravariant functors in scala
Refactoring Functional Type Classes
Sagas Middleware Architecture
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Les nouveautés de Java 19, 20 et 21 - RivieraDev 2023
recursion2
A Prelude of Purity: Scaling Back ZIO
ASP.NET Web API
Clean architecture
Next.js - ReactPlayIO.pptx
Ajax and Jquery
Exception Handling in C++
java 8 new features
Ad

Similar to OOP History and Core Concepts (20)

PPTX
1 intro
 
PDF
Object-Oriented Programming (OOP)
PPTX
Chapter 04 object oriented programming
PPTX
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING(OOP) AND PRINCIPLES.pptx
PPTX
Object oriented programming
PPT
Introduction.ppt JAVA SCRIPT PROGRAMMING AND
PPTX
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
PPT
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
PDF
L1-Introduction to OOPs concepts.pdf
PPTX
object oriented programming and methodology.pptx
PPTX
JAVA PROGRAMMINGD
PPTX
Intro to oop.pptx
PPT
Share Unit 1- Basic concept of object-oriented-programming.ppt
PPTX
Unit 1 OOSE
PPTX
Principles of OOPs.pptx
PPTX
Bab satu
PDF
babsatu-140703233001-phpapp666666601.pdf
PPTX
SKILLWISE - OOPS CONCEPT
PPTX
General oops concepts
1 intro
 
Object-Oriented Programming (OOP)
Chapter 04 object oriented programming
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING(OOP) AND PRINCIPLES.pptx
Object oriented programming
Introduction.ppt JAVA SCRIPT PROGRAMMING AND
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
L1-Introduction to OOPs concepts.pdf
object oriented programming and methodology.pptx
JAVA PROGRAMMINGD
Intro to oop.pptx
Share Unit 1- Basic concept of object-oriented-programming.ppt
Unit 1 OOSE
Principles of OOPs.pptx
Bab satu
babsatu-140703233001-phpapp666666601.pdf
SKILLWISE - OOPS CONCEPT
General oops concepts
Ad

Recently uploaded (20)

PPTX
L1 - Introduction to python Backend.pptx
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Transform Your Business with a Software ERP System
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Complete React Javascript Course Syllabus.pdf
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
Materi_Pemrograman_Komputer-Looping.pptx
PDF
AI in Product Development-omnex systems
PDF
Softaken Excel to vCard Converter Software.pdf
DOCX
The Five Best AI Cover Tools in 2025.docx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
top salesforce developer skills in 2025.pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Design an Analysis of Algorithms I-SECS-1021-03
L1 - Introduction to python Backend.pptx
How to Migrate SBCGlobal Email to Yahoo Easily
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Transform Your Business with a Software ERP System
Understanding Forklifts - TECH EHS Solution
Complete React Javascript Course Syllabus.pdf
ISO 45001 Occupational Health and Safety Management System
2025 Textile ERP Trends: SAP, Odoo & Oracle
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Materi_Pemrograman_Komputer-Looping.pptx
AI in Product Development-omnex systems
Softaken Excel to vCard Converter Software.pdf
The Five Best AI Cover Tools in 2025.docx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
top salesforce developer skills in 2025.pdf
Operating system designcfffgfgggggggvggggggggg
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Design an Analysis of Algorithms I-SECS-1021-03

OOP History and Core Concepts

  • 1. OOP History and Core Concepts Nghia Bui katatunix@gmail.com Nov 2017
  • 3. 3
  • 4. 4
  • 5. 5
  • 6. 6
  • 7. 8
  • 8. 9
  • 9. ‱ So a lot of people are complaining about OOP ‱ And we are still sitting here to talk about it??? 9 Read more at: http://www.yegor256.com/2016/08/15/what- is-wrong-object-oriented-programming.html
  • 10. The fact is that
 ‱ Asking 10 people about what is OOP, received 11 answers, e.g.: – “OOP is bundling data and functions together” – “OOP is programming with classes and inheritance” – “OOP is all about behavior” – “OOP is all about message passing” – “OOP is programming with abstraction, encapsulation, polymorphism, and inheritance” – 
 10
  • 11. The misuse of OOP ‱ OOP is just a tool in your programming toolbox ‱ Just like any tool, it can be misused ‱ OOP has been misused, both in academy and industry: – Focus too much on class inheritance: the strongest relationship which encourages tight-coupling – Abuse of mutable state: object state can change over time (with, e.g., setter methods) unnecessarily – Use god objects which defeat the purpose of objects: breaking-down program into small and manageable pieces called objects 11
  • 12. OOP is actually a good tool ‱ Every tool is good if you know what it is! ‱ That’s why we – as software developers – still need to learn OOP, but in a correct way! 12
  • 14. [1960s] Simula: the first OO lang ‱ Two Norwegians – Kristen Nygaard and Ole-Johan Dahl – working for the Norwegian Defense research ‱ In 1960s they created Simula to solve modeling problems: – “They were working on simulations that deal with exploding ships, and realized they could group the ships into different categories. Each ship type would have its own class, and the class would generate its unique behavior and data. Simula was not only responsible for introducing the concept of a class, but it also introduced the instance of a class.” ‱ Dahl–Nygaard Prize 14 Story: http://www.exforsys.com/tutorials/oops-concepts/the-history-of-object-oriented-programming.html Image: http://web.cecs.pdx.edu/~black/publications/O-JDahl.pdf
  • 15. [1970s] Smalltalk: the purist OO lang ‱ The term OOP was first used by Alan Kay at Xerox PARC in their Smalltalk language ‱ The term was used to refer to the process of using objects as the foundation for computation ‱ The Smalltalk team was inspired by the Simula project, but they designed Smalltalk so that it would be dynamic ‱ Purist: – Everything is an object – No primitive types (int, float
) – Message-passing style, not method-invocation style 15
  • 16. Since then
 1983: Bjarne Stroustrup ported the ideas of Simula to C to support simulation programming  “C with classes”  C++ 1984: Brad Cox added Smalltalk-style message- passing syntax to C and called it “Objective-C” 1995: Java – created by James Gosling – integrated implementation technology from Smalltalk and syntax from C++ 2000: C# is the main language of the .NET platform from Microsoft, it was created by Anders Hejlsberg, the most recent version is C# 7.1 16 Not to mention JavaScript, Ruby, Python

  • 17. OOP Motivation and Core Concepts In this section, only the core, essential, and general concepts of OOP are discussed, language concepts are ignored
  • 18. Behaviors and Data ‱ All software are about behaviors (*) operating on data, regardless the paradigm (Procedural/OO/Functional) ‱ Data has concepts of: – “type” (or “structure”) – “value” (or “state”) ‱ To operate on data, a behavior must: – understand the structure of the data – have ability of accessing/modifying/creating/deleting the state of the data ‱ Behavior A can make use of (interact with) behavior B 18 (*) you can think behaviors as functions/procedures, here I want to avoid using such language-specific terms, the term “behaviors” is more general
  • 19. Procedural programming (PP): data and behaviors are separated 19 ‱ The Person struct is likely to be used in many places ‱ Those places may accidentally change the state of the person data ‱ When the structure of Person changes, all of those places are affected  PROBLEM: data are used in large scopes  But it’s not the fault of PP, it’s a matter of discipline
  • 20. The solution/discipline of OOP ‱ Data must be used in a small scope called object ‱ Only the object has the direct access to its (internal) data ‱ The outside interacts with the object A by using the behavior exposed/provided by A ‱ Objects know about each other through behaviors, and make use of those behaviors by interacting/communicating ‱ When decomposing program into objects, only behaviors matter, data don’t 20
  • 21. OOP is all about behaviors! ‱ Each object has one behavior ‱ A behavior = a set of parameterized operations ‱ An object is recognized by its behavior, not its data 21
  • 22. The 4 characteristics of behaviors ‱ the behavior of an object is its abstraction Abstraction ‱ the behavior of an object encapsulates (hides) its (internal) details Encapsulation ‱ behaviors are polymorphic Polymorphism ‱ behaviors are inheritable Inheritance 22
  • 23. Abstraction ‱ The behavior of an object is its abstraction ‱ The abstraction of an object is: – the most essential thing of that object – the most impressive thing of that object – stable / unlikely to change ‱ Finding the right abstractions (i.e., correct behaviors) of objects is the key to programming with OO: – The right abs depends on the domain/app – What if we find the wrong abs? ‱ Wrong abs are likely to change 23
  • 24. Encapsulation ‱ The behavior of an object encapsulates (hides) its (internal) details ‱ Those details contain not only data but also everything that needs to be hidden ‱ Abstraction and encapsulation are very closed: – To achieve abstraction, we need encapsulation – When we do encapsulation, we have abstraction ‱ Anyway, both of them are the heart of OOP ‱ They are really good for managing the complicity of software 24
  • 25. Polymorphism ‱ Behaviors are polymorphic ‱ If an object a works with object b: – class A {void test(b){/*work with b*/}} – class A { private b; A(b) { this.b = b; } void test() {/*work with this.b*/} } ‱ Then we can pass any object c behaving like b to a and a still works well ‱ Benefit: Flexibility  Reusability 25 This technique is called “dependency injection”
  • 26. Inheritance ‱ Behaviors are inheritable ‱ If we have an object a has a behavior with 2 operations x() and y() ‱ Then there is a way to create an object b having those 2 operations, and optionally with extra customizations e.g.: – adding operation z() – removing operation x() – overriding operation y() ‱ Benefit: Reusability 26 Not all languages support this
  • 27. Inheritance controversy ‱ In its essence, there is nothing wrong about inheritance: – It is a way to create objects having the same behaviors to existing objects with optional customizations ‱ So where does the controversy come from? – Different languages have different ways to implement object creation – Thus, inheritance is implemented in very different ways, some ways are even different from the essence – Class inheritance in class-based & statically-typed languages is the problematic one; sadly, these languages are the most popular OOP languages 27
  • 28. OOP key notes ‱ Using behaviors as the basis of abstraction is the key of OOP. ‱ When a concept is abstracted and encapsulated by a polymorphic behavior, we call it an object. ‱ When we program / design by defining objects, creating objects and letting them interact in order to achieve dedicated tasks, we call it object-oriented programming / design. 28
  • 29. Core concept vs. language concepts Core ‱ Object, Behavior, Operation, Parameterized Operation, Interaction, Communication, Abstraction, Encapsulation, Polymorphism, Inheritance Lang ‱ Type, Class, Struct, Method, Property, Interface, Abstract Class, Public, Private, Protected, Method Overriding/Overloading, Virtual Method, Class Inheritance, Exception, Static Method/Property, Generic Type
 ‱ Class-based Style, Prototype-based Style ‱ Static Typing, Dynamic Typing 29