SlideShare a Scribd company logo
4
Most read
5
Most read
7
Most read
Liscov Substitution
Principle
S: Single Responsibility Principle
O: Open/Closed for Principle
L: Liskov Substitution Principle
I: Interface Segregation Principle
D: Dependency Inversion Principle
SOLID
Principles
2
OOD principles
Not design Patterns
By Bob Martin and
Michel Features
The principle, that Barbara
Liskov defined in 1987 in her
conference keynote named
"Data abstraction and
hierarchy".
Liscov Substitution
Principle
3
Liskov Substitution
Principle
4
Objects in a program
should be replaceable
with instances of their
subtypes without
altering the correctness
of that program.
Liskov Substitution
Principle
5
You should be able to
replace any instances of a
parent class with an
instance of one of its
children without creating
any unexpected or incorrect
behaviors.
Objects in a program should be replaceable with
instances of their subtypes without altering the
correctness of that program.
You should be able to replace any instances of a
parent class with an instance of one of its children
without creating any unexpected or incorrect
behaviors.
Liskov Substitution
Principle
6
If S is a subtype
of T, then objects
of type T may be
replaced with
objects of type S
7
If class Man is inherited
from class Human, then
objects of class Human
may be replaced with
objects of class Man.
8
If class ……….. is inherited
from class ……………., then
objects of class ……... may
be replaced with objects of
class ………....
9
…………...without altering the
correctness of that program.
Code Example
10
11
If class AdminUser is
inherited from class User,
then objects of class User
may be replaced with
objects of class AdminUser
Thank You
12

More Related Content

PPTX
Solid principles
PPT
SOLID Design Principles
PPT
principles of object oriented class design
PPTX
SOLID Principles
PDF
Solid Principles
PPTX
Solid principles
PPTX
SOLID principles
PPTX
Solid Principles
Solid principles
SOLID Design Principles
principles of object oriented class design
SOLID Principles
Solid Principles
Solid principles
SOLID principles
Solid Principles

What's hot (20)

PPTX
Design principles - SOLID
PPTX
Adapter Design Pattern
PDF
Gof design pattern
PPTX
Learning solid principles using c#
PDF
SOLID Design Principles applied in Java
KEY
Solid principles
PDF
Introduction to SOLID Principles
KEY
SOLID Design Principles
PPTX
Solid design principles
PDF
Introduction to Design Pattern
PPTX
Clean code: SOLID
PPTX
SOLID Principles
PPTX
Design Pattern - Factory Method Pattern
PPSX
Java annotations
PPT
Java interfaces & abstract classes
PPTX
Object Oriented Programming ppt presentation
PPTX
The Single Responsibility Principle
PPT
Adapter pattern
PPTX
Design Pattern - MVC, MVP and MVVM
Design principles - SOLID
Adapter Design Pattern
Gof design pattern
Learning solid principles using c#
SOLID Design Principles applied in Java
Solid principles
Introduction to SOLID Principles
SOLID Design Principles
Solid design principles
Introduction to Design Pattern
Clean code: SOLID
SOLID Principles
Design Pattern - Factory Method Pattern
Java annotations
Java interfaces & abstract classes
Object Oriented Programming ppt presentation
The Single Responsibility Principle
Adapter pattern
Design Pattern - MVC, MVP and MVVM
Ad

Similar to Liscov substitution principle (20)

PDF
Solid principles
PPTX
Solid js
PPTX
Solid
PPTX
An ultimate guide to SOLID Principles, developers must know.
PPT
design-principles.ppt
PPTX
Solid design principles
PPTX
SOLID Principles in OOPS ooooooooo.pptx
PPTX
The good, the bad and the SOLID
PPTX
Object Oriented Principle’s
PDF
SOLID Deconstruction
PPTX
Design Pattern lecture 1
PPTX
Solid principles
PPTX
SOLID Software Principles with C#
PPTX
From Good to SOLID: How to become a better PHP developer
PPTX
Solid principles
PPTX
#4 | Object Oriented Programming's SOLID Principles | Sameer Siddiqui
PPTX
Solid
PPTX
S.O.L.I.D: Principles of OOP and Agile design
PPT
OO design principles & heuristics
Solid principles
Solid js
Solid
An ultimate guide to SOLID Principles, developers must know.
design-principles.ppt
Solid design principles
SOLID Principles in OOPS ooooooooo.pptx
The good, the bad and the SOLID
Object Oriented Principle’s
SOLID Deconstruction
Design Pattern lecture 1
Solid principles
SOLID Software Principles with C#
From Good to SOLID: How to become a better PHP developer
Solid principles
#4 | Object Oriented Programming's SOLID Principles | Sameer Siddiqui
Solid
S.O.L.I.D: Principles of OOP and Agile design
OO design principles & heuristics
Ad

Recently uploaded (20)

PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
Geodesy 1.pptx...............................................
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Construction Project Organization Group 2.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPT
Mechanical Engineering MATERIALS Selection
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Digital Logic Computer Design lecture notes
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
Welding lecture in detail for understanding
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Well-logging-methods_new................
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Geodesy 1.pptx...............................................
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Construction Project Organization Group 2.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
CYBER-CRIMES AND SECURITY A guide to understanding
Embodied AI: Ushering in the Next Era of Intelligent Systems
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Mechanical Engineering MATERIALS Selection
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Digital Logic Computer Design lecture notes
bas. eng. economics group 4 presentation 1.pptx
Structs to JSON How Go Powers REST APIs.pdf
Welding lecture in detail for understanding
Foundation to blockchain - A guide to Blockchain Tech
Well-logging-methods_new................

Liscov substitution principle

  • 2. S: Single Responsibility Principle O: Open/Closed for Principle L: Liskov Substitution Principle I: Interface Segregation Principle D: Dependency Inversion Principle SOLID Principles 2 OOD principles Not design Patterns By Bob Martin and Michel Features
  • 3. The principle, that Barbara Liskov defined in 1987 in her conference keynote named "Data abstraction and hierarchy". Liscov Substitution Principle 3
  • 4. Liskov Substitution Principle 4 Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
  • 5. Liskov Substitution Principle 5 You should be able to replace any instances of a parent class with an instance of one of its children without creating any unexpected or incorrect behaviors.
  • 6. Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program. You should be able to replace any instances of a parent class with an instance of one of its children without creating any unexpected or incorrect behaviors. Liskov Substitution Principle 6 If S is a subtype of T, then objects of type T may be replaced with objects of type S
  • 7. 7 If class Man is inherited from class Human, then objects of class Human may be replaced with objects of class Man.
  • 8. 8 If class ……….. is inherited from class ……………., then objects of class ……... may be replaced with objects of class ………....
  • 11. 11 If class AdminUser is inherited from class User, then objects of class User may be replaced with objects of class AdminUser