4 ms·
Surely it follows logically anyway? Assuming sub/super are referring to inheritance (sorry, I'm a bad), a sub contains all of a super and more. Passing throug
by Ntrails 10y ago
Surely it follows logically anyway?
Assuming sub/super are referring to inheritance (sorry, I'm a bad), a sub contains all of a super and more. Passing through an object with more shouldn't break anything. But a super might lack things the sub has, thereby breaking assumptions about what will be present.
I feel like the principle would be broken by the objects/inheritance being badly used rather than the calling code though?
- talideon 10y agoLSP doesn't specifically deal with inheritance; it's equally applicable to interface implementation.