Quantcast
Channel: User Filip Milovanović - Software Engineering Stack Exchange
Viewing all articles
Browse latest Browse all 167

Comment by Filip Milovanović on What would be an example of the Liskov Substitution Principle, if you don't use inheritance?

$
0
0
@ScottyJamison - Yes, it's very much about the subtype relationship - the whole point of the Liskov & Wing paper ("A behavioral notion of subtyping") that introduced the notion was to lay out the criteria for what can sensibly be considered a subtype of some other type. Now in many languages, inheritance is required in order to have subtype polymorphism, but inheritance by itself doesn't guarantee that these criteria are met. The subtype has to meet, in a certain precise sense, the specification associated with the supertype, beyond what the compiler can check.

Viewing all articles
Browse latest Browse all 167

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>