Liskov substitution principle with abstract parent class
Posted
by
Songo
on Programmers
See other posts from Programmers
or by Songo
Published on 2014-06-06T16:12:39Z
Indexed on
2014/06/06
21:49 UTC
Read the original article
Hit count: 247
Does Liskov substitution principle apply to inheritance hierarchies where the parent is an abstract class the same way if the parent is a concrete class?
The Wikipedia page list several conditions that have to be met before a hierarchy is deemed to be correct. However, I have read in a blog post that one way to make things easier to conform to LSP is to use abstract parent instead of a concrete class.
How does the choice of the parent type (abstract vs concrete) impacts the LSP? Is it better to have an abstract base class whenever possible?
© Programmers or respective owner