Slide 13
Slide 13 text
Liskov Substitution Principle
• If it looks like a duck and quacks like a duck, but the duck
needs batteries, you’ve broken LSP (you have the wrong
abstraction)
• Preconditions
• return or raise if
• Postcondition
• Catch/Ensure
• Try to stay away from new exceptions specific for sub
classes. They are hard to catch.