> Wouldn't increasing access technically just be adding a member to the > subclass? A member that, publicly anyway, the superclass didn't have. > > What happens internally is pretty irrelevant. > > In my book, decreasing is always bad. I've seen it happen in some > Microsoft classes. It was really annoying. I can't imagine when this > would be a good idea.
Arjang kind of misrepresented what LSP is about. Not only is it not a "rule", and it's a principal, as the "P" indicates, it's not about restricting 'access' but restricting functionality. That is to say, if you were to follow LSP, you must have Rectangle inherit from Square, and not Square extending Rectangle (and having limiting conditions). -- silky Every morning when I wake up, I experience an exquisite joy — the joy of being this signature.
