Web lists-archives.com

Re: [PHP] How do I handle covariant parameters and not fall foul of LSP.

"Richard Quadling" wrote in message news:CAKUjMCXEXqy=VB8Jjjg8XKdUsc5NsqQTeZcs54+V5e4GH1RYYw@xxxxxxxxxxxxxx...


That's fine for concrete classes, but abstract classes which cannot be
instantiated, therefore cannot be swapped, cannot fall foul of LSP. It is
the abstract part that, in my mind, should be making the difference.

That is correct. LSP does not come into play when you inherit from an abstract class, only when you inherit from one concrete class to create a different concrete class. The author of LSP should have made this clear.

Tony Marston

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php