DEV Community

Discussion on: Liskov Substitution Principle in 3 Minutes

Collapse
 
danielrusnok profile image
Daniel Rusnok • Edited

Nice example of violation the LSP could be to make an animal purr. Everybody knows that only one who can purr in our domain are cats, that is why method Purr could not be in Animal class. Dog dont purr, dogs cant inherit such a behavior.

Collapse
 
pareshjoshi profile image
Paresh

That makes perfect sense!