3 ms·
Interfaces are inheritance as far as OOP design principles are concerned.
by seemslegit 6y ago
Interfaces are inheritance as far as OOP design principles are concerned.
- hinkley 6y agoYou're into structural versus nominal typing here, which is an important distinction (and tool) to point out.
- seemslegit 6y agoFirst, nominal is assumed because 'structural typing' was not a thing in any major language when the Liskov substitution principle was coined. Second, this is independent of structural vs nominal typing - implementation of an interface can be thought of as inheritance of a class whose methods all have noop implementations, and in fact this is (almost) how it's done in languages that don't have interfaces like C++