DEV Community

Discussion on: Liskov Substitution Principle in 3 Minutes

Collapse
 
schwarzwald profile image
schwarzwald • Edited

I think this is more an example of the strategy pattern than the LSP. If I understand it correctly LSP is about not breaking the contract of superclass with the implementation of subclass.

Collapse
 
erikwhiting88 profile image
Erik

You're right. I would argue, though, that the strategy pattern adheres to the Liskov Substitution Principle and is thus a good example for conceptualizing the principle, especially quickly