Liskov: The Liskov Substitution Principle

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
at the same time that I was developing clue and Bill and Mary were working on a Alphard alan kay and adele goldberg were working on small talk-- and on the west coast and although it may seem a little strange these days in those days it was a long way from the east coast to the west coast and of course we had no conference calls in those days too so that whole business about object-oriented programming was developing on the west coast and on the East Coast we were mostly working on data abstraction and the two worlds were kind of separated so I knew the name but we didn't run into each other at conferences and that was it wasn't much cross talk going on in the 1980s I was asked to give a keynote at Uppsala which I think had it was maybe the second OOP slide hadn't been in the existence very long and so I decided that this was a good opportunity to learn about what was going on in object-oriented languages and so I started reading all the papers and I discovered that hierarchy was being used for two different purposes one was simply inheritance so I have a class it implements something I can build a subclass I can borrow all that implementation change it however I want add a few extra methods change the representation whatever I want to do I just sort of borrow the code and keep working on it the other way was being used though was for type hierarchy so the idea was that the superclass would define a super type and then the subclass would extend this to become a subtype and I thought this idea of type hierarchy was very interesting but I also felt that they didn't understand it very well and I remember reading papers in which it was clear they were very confused about it because one in particular that I remember said that a stack at a queue were both subtypes of one another and this is clearly not true because if you wrote a program that expected a stack and you got a queue instead you would be very surprised by its behavior the difference between life oh and FIFO is a big deal and this led me to start thinking about what does it really mean to have a type a super type and a subtype and I came up with a rule an informal rule which I presented in my keynote at Uppsala which simply said that a subtype should behave like a super type as far as you can tell by using the super type methods so it wasn't that it couldn't behave differently it's just that as long as you limited your interaction with its objects to the super type methods you would get the behavior you expect it and this was an informal definition just given sort of based on intuition it's intuitively right in some sense you can see how you understand the super type you write some code in terms of the super type whatever object you get should be behave the way you expect otherwise how can you do this independent reasoning about behavior later on Genet wing who actually had been my master's student I think and then John Guttag PhD student approached me and said why don't we try to figure out precisely what this means and so we worked together on this and some papers that got published a bit later and meanwhile I was working on distributed computing I was particularly you know interested in view stamp replication and some of the other work that was going on in my group at the time and I wasn't really thinking about this until sometime in the 90s when I got an email from someone who said can you tell me if this is the correct meaning of the Liskov substitution principle so that was the first time I had any idea that there was such a thing that they and this name had developed technically it's called behavioral subtyping you know says sometimes behave like super types so I just thought that was very amusing I discovered there were lots and lots of people on the internet having arguments about what the Liskov substitution principle meant so it was nice to have something that had an impact like that
Info
Channel: Turing Awardee Clips
Views: 19,817
Rating: undefined out of 5
Keywords:
Id: -Z-17h3jG0A
Channel Id: undefined
Length: 4min 22sec (262 seconds)
Published: Sun Apr 19 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.